Skip to main content

Enforces conventional git commit messages for git repositories

Project description

pypi python implementation

license last-commit

follow

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 .

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"
Traceback (most recent call last):
  File "C:/Users/prahlad/Documents/scripts/check_commit.py", line 14, in <module>
	main()
  File "C:/Users/prahlad/Documents/scripts/check_commit.py", line 11, in main
	if m == None: raise Exception("conventional commit validation failed")
Exception: conventional commit validation failed

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

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

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

enforce-git-message-1.0.0.tar.gz (3.3 kB view hashes)

Uploaded Source

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