8000 feat: add Conventional Commit Support by hanna-greaves · Pull Request #1315 · d3fc/d3fc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 13 commits into from
Sep 4, 2019

Conversation

hanna-greaves
Copy link

Enables Commitizen integration and a CC lint check which is run on Travis during PRs

  • It would be nice to make this more of a warning rather than requirement on Travis but I do not currently have time to write the conditionals and PR commenting code for travis

Enables Commitizen integration and a CC lint check which is run on Travis during PRs
Copy link
Member
@ColinEberhardt ColinEberhardt left a 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 +----------------------------------------------+ &&",
Copy link
Member

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 `&&'

Copy link
Author
@hanna-greaves hanna-greaves Sep 3, 2019

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 ^| &&",
Copy link
Member

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?

Copy link
Author

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": [
Copy link
Member

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.

Copy link
Author
@hanna-greaves hanna-greaves Sep 3, 2019

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! :)

Copy link
Member
@ColinEberhardt ColinEberhardt left a 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.

@hanna-greaves hanna-greaves merged commit 477dcc4 into d3fc:master Sep 4, 2019
@hanna-greaves hanna-greaves deleted the hanna-enforce-cc branch September 4, 2019 15:48
@ColinEberhardt
Copy link
Member

Thanks for tidying up and merging 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0