Validates a git commit message against The seven rules:
- Separate subject from body with a blank line
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
The bolded rules 1-4 and 6 are checked. The remaining 2 are not detectable programmatically. The title of rule 2 says 50 characters but the body clarifies 72 is the hard limit.
Provides a husky hook for easy use.
Inspired by the quality Bash implementation by Silent Correspondent.
Install husky and the validator:
npm install husky --save-dev
npm install sevenrules --save-dev
Hook the validator to commitmsg
in your package.json
:
{
"scripts": {
"commitmsg": "sevenruleshusky"
}
}
Enjoy your clean commit log!
Respect agency. Follow the Code of Conduct.
Anybody caught using this work without our permission, will be mighty good friends of ourn, cause we don't give a dern. Study it. Hack it. Publish it, even without naming the source. We made it, that's all we wanted to do.
Released under the Severn license, an MIT derivative without the notice requirement. Contributor signatures available in the contributors repository.
NO rights reserved.