Skip to content

Simple usage? #775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
robcresswell opened this issue Aug 13, 2019 · 6 comments
Closed

Simple usage? #775

robcresswell opened this issue Aug 13, 2019 · 6 comments
Assignees

Comments

@robcresswell
Copy link

I'm unsure if I'm missing something here but... how do I use this in a straightforward way to lint the most recent commit?

Something like npx @commitlint/cli HEAD~1, assuming a relevant config file is in the same directory. The local setup doc immediately starts trying to make me install more dependencies and commit hooks, which is baffling to me.

@escapedcat
Copy link
Member

escapedcat commented Aug 14, 2019

Hey Rob, this seems to work for me:

npx commitlint --from HEAD~1 --to HEAD

Does this help in your situation?
Optionally you can add --verbose to get an output even if everything is fine.

@robcresswell
Copy link
Author

Yes! This is what I eventually figured out. I guess I was confused this wasn't higher up on the "getting started"; maybe thats just me though.

@escapedcat
Copy link
Member

Maybe... I actually searched the issues here and couldn't find something similar :)
Most people prefer using commitlint via a hook to avoid running it each time manually I guess. At least this didn't seem to be an issue so far.
Happy to hear some more context though.

@robcresswell
Copy link
Author

So my use case was that I wanted something simple to run in CI; so its a one liner that checks the last 10 commits currently, though I'll make that something more sensible i.e. the diff between develop and the feature branch

@escapedcat
Copy link
Member

Got it. There's an idea to make commitlint work with github-actions.
Maybe that would cover your usecase.

@robcresswell
Copy link
Author

Potentially; for me it was really just wanting the most basic functionality without having to setup extra things. Anyway, I've got it figured out, so I'll close the issue. Thanks for the help, and the quick responses.

@escapedcat escapedcat self-assigned this Aug 21, 2019
escapedcat added a commit that referenced this issue Aug 21, 2019
escapedcat added a commit that referenced this issue Aug 21, 2019
marionebl pushed a commit that referenced this issue Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants