derek
derek copied to clipboard
Encourage clean commit messages
I think Derek can help us with commit messages - as a sort of "linter"
Some may argue a pre-commit hook could do this, but it would have to live in every git repo - Derek can automate some of this.
This post by Chris Beans seems to be well-regarded in the larger community and is also referenced vey the Moby project: https://chris.beams.io/posts/git-commit/
- Always start a commit subject (first line) with a capital letter
- Never exceed 50 chars for the first line of a commit message
- When a commit body is given make sure it wraps to 70 chars max per line
This would be a "feature" and it would be up to the project maintainers as to what they do with the information.
If the rules are invalidated a label could be added with a comment. When the rules are valid the label will be removed. You could get the label more than once but not whilst the "label" is still in place.
Label could be: review/commit-msg
I've started looking at this but I would like input
I think you've covered it well already.
Feels like the lengths should be configurable as they are rules of thumb. If people have downstream systems for reviewing commits that use different limit then should should be able to tailor.
Should the subject line check assess for capital letter and full stop?
Suggest the feature be called commit_check or message_check to align with the dco_check
When both DCO and commit message fail should the feedback be merged into a single comment with a pointed list of concerns & advice on resolving?
Derek add label: PR
PR via #43
cc @nishakm from VMware who was looking into commit message linting.