Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Enforces conventional git commit messages for git repositories

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for enforce-git-message, version 1.0.1
Filename, size File type Python version Upload date Hashes
Filename, size enforce-git-message-1.0.1.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page