This hook is made as a custom plugin under the pre-commit hook framework and checks if commit message matches the chaos-hub team commit rules.
pip install commit-msg-hook
For more details see: pre-commit
pip install pre-commit
- repo: https://github.com/dimaka-wix/commit-msg-hook.git
rev: v0.3.4
hooks:
- id: commit-msg-hook
stages: [commit-msg]
pre-commit install --hook-type commit-msg
pre-commit autoupdate --repo https://github.com/dimaka-wix/commit-msg-hook.git
- Write up to 72 characters(preventing ellipsis in git)
- Capitalize the subject line
- Use the imperative mood(e.g. Add instead of Added, Adds or Adding)
- Do not end the lines with any punctuation character
- Use the description to explain what and why vs how
- In case of multiline message do the following:
- Press Shift+Enter to create a new line and to write more characters then vscode lets you
- Separate subject line from message body with a blank line
- Follow the rules above when writing each line of the message
Refactor foo function in x file from y component
* Remove duplications
* Add docstrings
* Update the types of arguments
SKIP=commit-msg-hook git commit -m "Your message"
git commit -m "Your message" --no-verify
git commit -m "Your message" -n (not recommended)