Enforces conventional git commit messages for git repositories
Project description
enforce-git-message
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
- Tick Icon made by smashicons from www.flaticon.com is licensed by CC 3.0 BY
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
Close
Hashes for enforce-git-message-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fabdcf708c7e05bb7c1acdfd30eb518852be5ce16683a1962424cc565dcf960 |
|
MD5 | 3f3c263f9076c5969c41c987948d0369 |
|
BLAKE2b-256 | 30d19dcc296e842f920aa44c6a42a80ee59cbb1be75d2f005da9edda12b4242e |