Skip to main content

Checks if commit message matches the chaos-hub commit rules

Project description

commit-msg-hook

Checks if commit message matches the chaos-hub 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: https://github.com/DimaKarpukhin/commit-msg-hook.git
    rev: "0.0.1"
    hooks:
    -   id: commit-msg-hook
        args: [--m]  
        stages: [commit-msg]

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
    • Fix ...
    • Add ...
    • Refactor ...
    • Update ...
    • Remove ...
    • Release ...
    • Move ... to ...
    • Tslint ... in ...
    • Rename ...
    • Merge branch ...
  • 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!
  • Use In/From format in suject line to add the place where the change was made (file/component)

Example

Refactor Z function in X file from Y component

- Fix ...
- Add ...
- Update ...

Bypass the hook

git commit -m "Your message" --no-verify

or

git commit -m "Your message" -n

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

Uploaded Source

Built Distribution

commit_msg_hook-0.0.1-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: commit-msg-hook-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 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.0.1.tar.gz
Algorithm Hash digest
SHA256 9d71487d1c31c953327db7e84960cb72994584b68a7bf13f14b7f1a793b6594b
MD5 3a39625c4e1d62086f6b446b7428e4f7
BLAKE2b-256 ca6d6913cbb2325bce31de5cad1993ff0c04ebae96e4c59cc6ebfe8da373e4b9

See more details on using hashes here.

File details

Details for the file commit_msg_hook-0.0.1-py2-none-any.whl.

File metadata

  • Download URL: commit_msg_hook-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2
  • 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.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 d0573e1d9ee6361f2e7bb15b157bda7010d8b6acf221b7f8084dc89805e501b6
MD5 4dbedf281c030d7d8a68ebbb7dc94305
BLAKE2b-256 6f35c364a8dcb26fb34e48d81f4e4650f70da70a660e4a0b46179c4b14df9013

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