Skip to content
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

Encourage clean commit messages #42

Open
alexellis opened this issue Mar 17, 2018 · 5 comments
Open

Encourage clean commit messages #42

alexellis opened this issue Mar 17, 2018 · 5 comments
Labels

Comments

@alexellis
Copy link
Owner

alexellis commented Mar 17, 2018

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

@alexellis
Copy link
Owner Author

I've started looking at this but I would like input

@rgee0
Copy link
Contributor

rgee0 commented Mar 18, 2018

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?

@rgee0
Copy link
Contributor

rgee0 commented Mar 25, 2018

Derek add label: PR

@derek derek bot added the PR label Mar 25, 2018
@alexellis
Copy link
Owner Author

PR via #43

@alexellis
Copy link
Owner Author

cc @nishakm from VMware who was looking into commit message linting.

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

No branches or pull requests

2 participants