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
For more details see: pre-commit
Install pre-commit package manager
pip install pre-commit
Create a file .pre-commit-config.yaml
in the root folder with the following configuration
- repo: https://github.com/dimaka-wix/commit-msg-hook.git
rev: v0.3.0
hooks:
- id: commit-msg-hook
stages: [commit-msg]
To enable commit-msg hook with pre-commit run:
pre-commit install --hook-type 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)
- Capitalize the subject line
- Do not end the subject line with any punctuation character
- Use the imperative mood(e.g. Add instead of Added or Adds)
- 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
* 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
commit-msg-hook-0.3.0.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for commit_msg_hook-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfbaf9ab18c35aa97015a4f25213fd47847ff3cb329acb96d999912f78c087fb |
|
MD5 | 809f214edcdab8810c724fc1bd5bcdb1 |
|
BLAKE2b-256 | cc2544e8231d1f90c7b4f762724c2b3c136fa819a80b944f4b24a85e9eacb45f |