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.2.9
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.2.9.tar.gz
(5.4 kB
view details)
Built Distribution
File details
Details for the file commit-msg-hook-0.2.9.tar.gz
.
File metadata
- Download URL: commit-msg-hook-0.2.9.tar.gz
- Upload date:
- Size: 5.4 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 | 86daedaab37a7e78747ea5a8176b26f157f20c1a4962830227e4e1648f0d9717 |
|
MD5 | a8cbaa5d511e54a1f188f099ef1d202f |
|
BLAKE2b-256 | bb25ae6c960bf85d357dbf125b9650e5616556887c900d89eb9d108491631035 |
File details
Details for the file commit_msg_hook-0.2.9-py2.py3-none-any.whl
.
File metadata
- Download URL: commit_msg_hook-0.2.9-py2.py3-none-any.whl
- Upload date:
- Size: 5.9 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 | b32afdfcea2d135d33f53ddbc62d36664d2aebc7ff9e88fa6f847f21a583627e |
|
MD5 | ac85c2602ca2a146d26f680df71e6d1b |
|
BLAKE2b-256 | 2417a37250910055cd94faad1d39f065f94e97c67623d3a00a2c6e51222b9c28 |