-
Notifications
You must be signed in to change notification settings - Fork 197
feat: add Conventional Commit Support #1315
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
Conversation
Enables Commitizen integration and a CC lint check which is run on Travis during PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I've just tested it out and it looks really useful. I've not come across Commitizen before, a very handy tool indeed!
Just a few minor comments.
package.json
Outdated
"husky": { | ||
"hooks": { | ||
"prepare-commit-msg": [ | ||
"echo +----------------------------------------------+ &&", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is windows specific ...
husky > prepare-commit-msg (node v10.7.0)
/bin/sh: -c: line 0: syntax error near unexpected token `&&'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved this into a js file inside /scripts
to avoid this issue and to declutter the package.json
file
package.json
Outdated
"prepare-commit-msg": [ | ||
"echo +----------------------------------------------+ &&", | ||
"echo.^| This repo is Commitzen Friendly! ^| &&", | ||
"echo.^| Use git cz to generate a conventional commit ^| &&", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think git cz
assumes that they have installed commitizen globally?
Is it worth recommending npx git-cz
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right, nice catch, thanks
package.json
Outdated
}, | ||
"husky": { | ||
"hooks": { | ||
"prepare-commit-msg": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familiar with git hooks - I guess this is intended to display a notice whenever someone commits? In this case, I think it should (1) indicate that they need to use conventional commits and (2) suggest that they use commitizen to generate them.
The way it is worded at the moment implies that they must use git cz
to generate commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this executes just before git opens vim (or your usual terminal editor) for you to edit the default commit message. In *nix world there's a nice command that will automatically redirect git commit calls to npx git-cz but unfortunately this doesn't work cross platform so I opted to just give a notice :)
will update the message to be more clear! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates @hanna-greaves - just tried this out and it works perfectly :-)
I've approved, can you please resolve the package.json
conflicts then I'd be happy to merge. Thanks again.
Enables Commitizen integration and a CC lint check which is run on Travis during PRs
Thanks for tidying up and merging 👍 |
Enables Commitizen integration and a CC lint check which is run on Travis during PRs