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
Documentation to work with commitlint? #122
Comments
Hi @radiosilence Maybe that what a you looking for? |
I use it like this: pre-commit:
parallel: true
commands:
lint-commit:
run: npx commitlint --from HEAD~1 --to HEAD |
@muuvmuuv Somehow, this doesn't work for me. I also read, that the |
@Arkweid I took a look at your example using the bash script. I'm trying to figure out how this could be used with a tool like commitlint without using a separate script file. Is there a way to access the commit message in the run command? Maybe using an environment variable or an argument? |
For simple |
Oh, sorry, noticed that my above does not work, but this one does: commit-msg:
commands:
lint-commit-msg:
run: npx commitlint --edit
|
I have a similar use-case with Has someone had success doing this? EDIT: I can see in https://github.com/Arkweid/lefthook/blob/master/docs/full_guide.md#git-hook-argument-shorthands-in-commands that a specific Git hook argument at position |
@paambaati where is this related to Commitlint? Post a new issue for this please. |
For me the above one was linting previous commit message instead of the current one. run: lefthook add -d commit-msg
# will create .lefthook/commit-msg dir Inside if ! npx commitlint --edit --verbose; then
exit 1
fi Then in commit-msg:
scripts:
'commit_check':
runner: bash Ref: https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md#managing-scripts |
I think we can close this since this guide already solved this issue. |
Unfortunately the commitlint documentation only has these instructions:
And it's unclear whether lefthook exposes whatever
HUSKY_GIT_PARAMS
are in such a way that it works with commitlint.The text was updated successfully, but these errors were encountered: