-
Notifications
You must be signed in to change notification settings - Fork 934
commitlint ignores commit messages starting with hashtag "#" #3208
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
Comments
Hey, yeah this would be a bug. I just tried this with the current version and couldn't reproduce this. Please see if updating solves this for you. If not we need to check a bit more I guess. |
Hi @escapedcat. Thanks for your reply. I have updated to version May I ask which version you are using? You said the current version, so I'm guessing just the most up 2 date one? I would like to try the same that you are using. |
I just confirmed, when using 17.0.1 this issue is resolved. Commiting with a message as described now leads to an error
Since my bug was for an |
Yay! 🎉 |
Yes, makes sense! You also state that in the README.md so no worries! We now updated to v17.0.1 Thanks for this library and the quick support |
Expected Behavior
commitlint -e
fails when type is not present and a hashtag is used at the beginning of the commit messageCurrent Behavior
commitlint -e
succeeds when omitting a type and using a hashtag at the beginning of the commit messageAffected packages
Possible Solution
Is a
#
maybe interpeted as a comment, and thus succeeds?Steps to Reproduce (for bugs)
We have a
.husky/pre-commit
file with the following contentsOur
.commitlintrc.json
looks like thisUsing this configuration, writing in CLI
git commit -m "foo: bar"
leads towhile
git commit -m "#8299-fix-prettier"
leads toMy suspicion is that it's somehow interpeted as comment? But shouldn't it still fail, since we have the always rule case regarding the type.
Context
We are using azure devops, so in order to link workitems (tickets) to a commit, we used the commit message template
#1234 Add foo
before. We now switched to conventional commits and have a pre-commit hook.However, some developers still need to adjust to these changes and accidentally commit with the wrong commit message. This shouldn't be a problem, since we have pre-commit hooks, however the pre-commit hook is not triggered when using a hashtag as a commit message
Your Environment
commitlint --version
git --version
node --version
The text was updated successfully, but these errors were encountered: