-
Notifications
You must be signed in to change notification settings - Fork 551
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
Strategies for enforcing commitizen #161
Comments
I agree that exit codes need to be fixed. One thing you can do to enforce this on your CI is set up this: |
Also, from a purely ideological standpoint. Commitizen is a purely opt in tool since not doing so would harm those that are capable of following the convention without this tool. For those people, forcing a tool on them is inadvisable. With that said, if you're in a situation where you need to ensure that people are following the convention, then validate-commit-msg should be used with commitizen. It makes sure that the conventions are being followed. I'd love to see someone from the community find a way to make validate-commit-msg have adapters in the same way that commitizen has adapters since not everyone uses the conventional changelog. For example, some people use Jira smart commits, and they probably still would like to be able to validate their commit messages. I'd be open to hearing alternative solutions to the problem as well. Thanks! Jim |
Hi @LinusU. Were you able to figure out enforcement of commit conventions? |
Not yet, but I'm thinking something towards having a small script check the log running on Travis or similar... |
Could this be adressed by a |
That could be a good idea 👍 The way I ended up solving it was to let my adapter have a "bin" field in the package.json that exposed a small verify command. Since it's already included in my devDependencies it was easy to add it to my test script. e.g. {
"scripts": {
"test": "mocha && cz-linusu verify HEAD..master"
},
"devDependencies": {
"cz-linusu": "^0.1.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-linusu"
}
}
} |
My strategy is like this. It prevents
|
Use Husky to overide standard git commit
|
I'm not sure that this is the right place to open this but here goes; have there been any discussions on how to enforce commitizen? We started using it in a few projects at work but it's both easy to forget and hard to make sure that everyone committing to the project respects it.
Maybe an idea would be to add a
commitizen check master
that checks all commits that have been added on this branch when compared to master. The exit code should be 0 (success) when all messages looks good.This way we can run that as part of our CI step.
Any ideas?
The text was updated successfully, but these errors were encountered: