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
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| enforce-git-message-1.0.1.tar.gz | 4.1 kB | Without provenance | Details for enforce-git-message-1.0.1.tar.gz |
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
|
Security for enforce-git-message 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.