Skip to main content

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.4
  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
  • Use the imperative mood(e.g. Add instead of Added, Adds or Adding)
  • Do not end the lines with any punctuation character
  • Use the description to explain what and why vs how
  • In case of multiline message do the following:
    • Press Shift+Enter to create a new line and to write more characters then vscode lets you
    • Separate subject line from message body with a blank line
    • Follow the rules above when writing each line of the message

Example

Refactor foo function in x file from y component

* Remove duplications
* Add docstrings
* Update the types of arguments

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

Uploaded Source

Built Distribution

commit_msg_hook-0.3.4-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.3.4.tar.gz.

File metadata

  • Download URL: commit-msg-hook-0.3.4.tar.gz
  • Upload date:
  • Size: 5.3 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.7

File hashes

Hashes for commit-msg-hook-0.3.4.tar.gz
Algorithm Hash digest
SHA256 8ccbf449e69537866562a813f08a3e7ca5d6d0f88fc39c9e903f3634d77c37a4
MD5 5161aaa1c377e5107c944ea1876d0f4f
BLAKE2b-256 7210ab7b74881cd19caffe517c16129aa04541eb371947815dddbb3f4e4a75e4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for commit_msg_hook-0.3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 43ba0fcca3b50acd8384ab4621e5eefe89ac9b2725f85626fa66889e27cadc71
MD5 dcd402976be2bac8b5d2d38e51da90dd
BLAKE2b-256 b51fba8945df403a62b3b122fdfa7ea386102c8921897fb612788e1740cff9a0

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