-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(commit message): use commitplease to validate commit messages #14888
Conversation
I am not sure we want to impose this to all contributors. We do support commitizen to help people format their messages, but failing when the are not following the conventions is a bit harsh I think. |
I haven't yet looked at commitizen, but in regards to, "but failing when the are not following the conventions is a bit harsh I think.", that's a fair concern. I originally developed this module for jQuery Foundation projects, where its been in use for more than 2 years (different validation rules, otherwise same approach). As far as I know, it has been working pretty well. Since the tool provides immediate feedback, its easy to try again and fix the issue (unlike a CI feedback loop, where there's often several minutes between making a change and getting feedback). You could give it a try. If there are issues, we can help improve the feedback. As kind of a last resort, you could set |
Here are a few problems with commitizen that I found:
|
Actually I like the look of this. We can starts lines with Let's install it and try it for a bit. If it is not working or too annoying then we can always remove it again. @all3fox is there a clean "uninstall" of this module? |
@petebacondarwin, glad to hear that! Here is a clean uninstall procedure:
If you find any bugs/annoyances, do not hesitate to report them here or in this PR! As a side note, here are ways to do dirty commits:
|
Is it not possible to have a |
I tried this out and it doesn't work with GUIs like SmartGit - primarily because, I believe, that the GUI doesn't know what version of node is needed and where to find that node. |
@petebacondarwin about the automatic git hook uninstall: There used to be a problem with commitplease We have solved our problem by releasing commitplease Unfortunately, the problem remains with I have also tried the I will take a look at SmartGit now. |
Remove validate-commit-msg.js and its tests
Here's an altenative PR that adds a manual check to the Travis CI_CHECKS job: #16097 the git hook is turned off. This will provide feedback to contributors without getting in the way of doing some dirty commits. I trust committers who push directly to the repo to use correct commit messages ;) Most changes go through PRs anyway. |
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. The git hook integration is turned off. Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway. Related to angular#14888
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. The git hook integration is turned off. Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway. Note that "Merge commit" messages and everything starting with "WIP" is always allowed by commitplease. Follow issue jzaefferer/commitplease#101 for more info. Related to #14888 Closes #16097
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. The git hook integration is turned off. Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway. Note that "Merge commit" messages and everything starting with "WIP" is always allowed by commitplease. Follow issue jzaefferer/commitplease#101 for more info. Related to angular#14888 Closes angular#16097
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. The git hook integration is turned off. Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway. Note that "Merge commit" messages and everything starting with "WIP" is always allowed by commitplease. Follow issue jzaefferer/commitplease#101 for more info. Related to angular#14888 Closes angular#16097
This will provide feedback to contributors without getting in the way of writing invalid commit messages locally. The git hook integration is turned off. Committers who push directly to the repo can be expected to use correct commit messages ;) Most changes go through PRs anyway. Note that "Merge commit" messages and everything starting with "WIP" is always allowed by commitplease. Follow issue jzaefferer/commitplease#101 for more info. Related to #14888 Closes #16097
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Outsource commit message validation, automate installing as git commit-msg hook.
What is the current behavior? (You can also link to an open issue here)
There is a
validate-commit-msg.js
that can be called manually or linked as a git hook viainit-repo.sh
.What is the new behavior (if this is a feature change)?
A dependency on commitplease, an external npm module, to do the commit message style checks.
Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements
Tests for the changes have been added (for bug fixes / features)Other information:
Pros of using:
validate-commit-msg.js
orinit-repo.sh
npm install
and runs withgit commit
How to try out:
Now try to commit some changes with valid/invalid commit messages.
How to go back:
Disclaimer: I am contributing to commitplease as part of the Google Summer of Code project for students.