Checks if commit message matches the chaos-hub commit rules
Project description
commit-msg-hook
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.
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: hhttps://github.com/dimaka-wix/commit-msg-hook.git
rev: v0.2.6
hooks:
- id: commit-msg-hookcs
stages: [commit-msg]
Add valid prefixes(optional)
Add additional prefixes as an args:
separated by ,
after the keyword --prefix
and end with the delimiter --
Example
hooks:
- id: commit-msg-hookcs
args: [--prefix, Check, Modify, --]
stages: [commit-msg]
Update to the latest release (optional)
pre-commit autoupdate --repo https://github.com/dimaka-wix/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
- Add ...
- Change ...
- Create ...
- Disable ...
- Fix ...
- Merge ...
- Move ...
- Refactor ...
- Release ...
- Remove ...
- Rename ...
- Tslint ...
- Update ...
- 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!
Example
Refactor Z function in X file from Y component
<optional part, adding it leave an empty line here>
- Fix ...
- Add ...
- Update ...
Bypass the hook in one of the following ways
SKIP=commit-msg-hook git commit -m "Your message"
git commit -m "Your message" --no-verify
git commit -m "Your message" -n (not recommended)
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
Built Distribution
File details
Details for the file commit-msg-hook-0.2.6.tar.gz
.
File metadata
- Download URL: commit-msg-hook-0.2.6.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d88dca0b633ab7f3e49223f17e2d99c7d7b921801bd06b7d35c78cb12d9d95f |
|
MD5 | b9823992b27e2d4a74b552a662c600db |
|
BLAKE2b-256 | 7f862ca32dac6e69a9f5033dd5b120db64e43b3f2f72b386bfea020800c63af5 |
File details
Details for the file commit_msg_hook-0.2.6-py2.py3-none-any.whl
.
File metadata
- Download URL: commit_msg_hook-0.2.6-py2.py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 885ab5e349d1562a6d83ada84acb1878c52777bd2eb8fbc75a16f8a4093c0e21 |
|
MD5 | 268aa64757082e0a56162fc42a831222 |
|
BLAKE2b-256 | 138a85cecd5b5684456543197b811a19dd80068dad4aed00686720ff7c61e019 |