Skip to main content

pypi python implementation

license last-commit

donate follow

enforce-git-message

project logo

Enforces conventional git commit messages for all new git repositories you create by running git init. For existing repositories, you can go to your source directory and simply run:

enforce-git-message

Examples of valid commit messages:

+ 61c8ca9 fix: navbar not responsive on mobile
+ 479c48b test: prepared test cases for user authentication
+ a992020 chore: moved to semantic versioning
+ b818120 fix: button click even handler firing twice
+ c6e9a97 fix: login page css
+ dfdc715 feat(auth): added social login using twitter

Examples of invalid commit messages resulting in an error message:

- 61c8ca9 fix for navbar not responsive on mobile
- 479c48b prepared test cases for user authentication
- a992020 moved to semantic versioning
- b818120 fixed button click even handler firing twice
- c6e9a97 login page css fix
- dfdc715 added social login auth feature using twitter

Installation

pip install enforce-git-message

Verifying

Go to your source folder and try to commit with a non-conventional message like this and it should fail:

> git commit -m "added a new feature for xyz"

COMMIT FAILED!

Please enter commit message in the conventional format and try to commit again. Examples:

+ 61c8ca9 fix: navbar not responsive on mobile
+ 479c48b test: prepared test cases for user authentication
+ a992020 chore: moved to semantic versioning
+ b818120 fix: button click even handler firing twice
+ c6e9a97 fix: login page css
+ dfdc715 feat(auth): added social login using twitter

After that, try doing the commit with a valid message and it should work:

> git commit -m "feat(test): added xyz"
>

Notes

Read this article to fully understand how the enforcement actually works by using git hooks.

Attribution

Metadata

Release files for enforce-git-message 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enforce-git-message 1.0.1
File Size Uploaded
enforce-git-message-1.0.1.tar.gz 4.1 kB Details

Release files / enforce-git-message-1.0.1.tar.gz

Download URL enforce-git-message-1.0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1fabdcf708c7e05bb7c1acdfd30eb518852be5ce16683a1962424cc565dcf960
BLAKE2b-256 checksum
How to use checksums
30d19dcc296e842f920aa44c6a42a80ee59cbb1be75d2f005da9edda12b4242e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page