Checks if commit message matches the chaos-hub commit rules
Project description
commit-msg-hook
This hook is made as custom plugins under the pre-commit hook framework and checks if commit message matches the chaos-hub team commit rules.
Installation
pip install commit-msg-hook
Using commit-msg-hook with pre-commit
See pre-commit for instructions
Add this to your .pre-commit-config.yaml
- repo: https://github.com/DimaKarpukhin/commit-msg-hook.git
rev: v0.1.6
hooks:
- id: commit-msg-hook
stages: [commit-msg]
# args is optional, the default length limit is 72
args: [--max-msg-length=<number>]
Update to the latest release (optional)
pre-commit autoupdate --repo https://github.com/DimaKarpukhin/commit-msg-hook.git
Commit Rules
- Write up to 72 characters(preventing ellipsis in git)
- Capitalise the subject line
- Do not end the subject line with a period
- Use the imperative mood(e.g. Add instead of Added)
- Start message with one of following prefixes
- Fix ...
- Add ...
- Refactor ...
- Update ...
- Remove ...
- Release ...
- Move ...
- Tslint ...
- Rename ...
- Merge ...
- Use the description to explain what and why vs how
- Press Shift+Enter to create a new line and to write more characters then vscode lets you
- Separate subject from body with a blank line!
- Use in/from format in suject line to add the place where the change was made (file/component)
Example
Refactor Z function in X file from Y component
- Fix ...
- Add ...
- Update ...
Bypass the hook
git commit -m "Your message" --no-verify
or
git commit -m "Your message" -n
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
commit-msg-hook-0.1.6.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for commit_msg_hook-0.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d37cddf2b2aca3c6664fa2c3052a54d7eb557781ac3679c8d43b5287078225 |
|
MD5 | 92a0218246fc75b3422974cfc0a0672f |
|
BLAKE2b-256 | 426a25be6d49e1b5d36dae19a6db2faaafcbefdb189da3023398ed52974bed06 |