-
Notifications
You must be signed in to change notification settings - Fork 401
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
feat(git): enforce commit message validation #78
Conversation
Benchmark comparisonBase commit:
|
"multiple":false | ||
}, | ||
"warnOnFail":false, | ||
"maxSubjectLength":100, |
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.
140 tweet anyone? 🐦 kidding alone, what's the one line limit in GitHub before ...
gets generated?
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.
We can tweak it to our likings, but quick search revealed this 50/72 rule, where ideal length is 50 characters - but in my opinion its a bit short given that we have to include type and scope. https://medium.com/@preslavrachev/what-s-with-the-50-72-rule-8a906f61f09c
Benchmark comparisonBase commit:
|
@apapko rebase and push |
Benchmark comparisonBase commit:
|
this PR has a lot of commits, and changes that were already integrated into master! |
@caridy it seem like there was a git glitch, it didn't pick up my rebase changes. @trevor-bliss showed me a trick to switch base and it solve the issue. |
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.
BTW I got the following error when I tried to commit locally:
.git/hooks/pre-commit: line 2: ./node_modules/pre-commit/hook: No such file or directory
I fixed by running rm .git/hooks/pre-commit
Details
Enforce commit message validation to comply with conventional-commit. Fixes #55
Problem:
During squash and merge, git uses pull request title, ci-enforced to be formatted to comply with conventional-commit standard, as a merge commit message. These formatted commits are then picked up by our changelog library during the release to generate release entries.
Unfortunately, above flow doesn't work when pull request contains only one commit. In which case, git uses the commit message itself instead of the pull request title, which won't be picked up by the changelog library during release because it has not been formatted.
Solution:
In order to solve above issue and further improve commit message consistency, we will enable commit message validation. This will ensure that the commit messages are always formatted - whether you are doing squash and merge from the ui or manual merging, the validation will guarantee that the important commits will always make it to our release changelog.
Hopefully by now developers are used to simple and readable format and won't find enforced formatting too tedious. :
Please note, the scope is optional and if you are adding review comments or saving work in progress you can simply do:
However, I would like to gather feedback from the team before enabling this feature.
Sample Output:
Does this PR introduce a breaking change?
If yes, please describe the impact and migration path for existing applications:
Please check if your PR fulfills the following requirements: