-
Notifications
You must be signed in to change notification settings - Fork 736
[git] Add scafolding for commit message standardization #4129
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## contribution-guidelines #4129 +/- ##
========================================================
Coverage 89.31% 89.31%
========================================================
Files 259 259
Lines 15684 15684
========================================================
Hits 14008 14008
Misses 1676 1676 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6ba0e31 to
62445ee
Compare
5598edb to
ea47b98
Compare
ea47b98 to
22a47f3
Compare
25d7bb9 to
7231fa0
Compare
|
OK, I think this is ready (provided the base merges). Here is a workflow run with bad commits: https://github.com/canonical/multipass/actions/runs/16480729443/job/46594055132?pr=4272 @sharder996, would you recommend having this workflow in the branch protection, or as part of dynamic CI? |
Add a basic main function to the commit-msg verification script, verifying that it is invoked with the expected argument.
Read commit message, reporting any errors.
Give up checking whether rule 9 holds because there is no way to know with certainty whether a sentence-ending line also ends the paragraph, without relying on a blank line to separate it from the following one. As, for example, in the previous line and this one :) We could detect cases where the first word(s) of the following line could still fit in the line that ended the sentence, but that could also be just a case of poor wrapping. For example: This is a sentence. And this is another one. There is no way to decide if the above is a case of a paragraph without a blank line or just sub-optimal wrapping. I am opting not to enforce optimal wrapping at this point, since it is not explicitly required by the current rules. And poems should be allowed :)
Fix commit verification not failing due to sub-shell not updating outer variable that was used to indicate failure. Use a file 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.
Yep LGTM! Getting used to capitalizing the first word of every commit will take some time 😅
| - Consider setting your commit template to the .gitmessage file in the repository root: | ||
| * `git config --local commit.template .gitmessage` | ||
| - Consider adding the commit-msg file in the repository root as a git hook (in .git/hooks) | ||
| * `ln -s ../../git-hooks/commit-msg.py .git/hooks/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.
This would probably fail if one switches back to an older branch. I've tested with main, git didn't complain, so it shouldn't be an 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.
LGTM 👍
Add a commit message template, a python script to serve as a validation hook, and a workflow to verify PR commits with that script.
MULTI-2014, MULTI-2015, MULTI-2016, MULTI-2017, MULTI-2018