Skip to main content

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: hhttps://github.com/dimaka-wix/commit-msg-hook.git
    rev: v0.2.5
    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


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.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

commit_msg_hook-0.2.5-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file commit-msg-hook-0.2.5.tar.gz.

File metadata

  • Download URL: commit-msg-hook-0.2.5.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

Hashes for commit-msg-hook-0.2.5.tar.gz
Algorithm Hash digest
SHA256 10e15f22c9d56e9a872ffe0fbb53f54582061d92d0484008addeaa2c8ff332d4
MD5 0a517f8117d951e4b731271eec443348
BLAKE2b-256 ac3b30e1178acfc4b9e467bd21fa291651c1be5057e7fc0cdf60df5a3c706356

See more details on using hashes here.

File details

Details for the file commit_msg_hook-0.2.5-py2.py3-none-any.whl.

File metadata

  • Download URL: commit_msg_hook-0.2.5-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

Hashes for commit_msg_hook-0.2.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 256b1fc08306f44d984dc9cd82adde1c845766d1a9e1f5bc8b6f584febd591e2
MD5 9e744053fdbc7eb0d3a7bd53c5b6fc8d
BLAKE2b-256 ba89ac828d9ad60f54871fde0fdd04ba5f729c80fee64e3e6ec3c95be35c5b7a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page