commit-message-validator is a tool that validates commit messages to our commit message guidelines. It requires Python 3.6+. The preferred method of installation is to use a virtualenv and git hooks.
# <translate nowrap><!--T:12--> Create a new virtualenv in the directory "cmv" in your home directory</translate>
cd ~
virtualenv cmv
# <translate nowrap><!--T:13--> Install from pypi</translate>
~/cmv/bin/pip install commit-message-validator
# <translate nowrap><!--T:5--> Configure the git hook.</translate> <translate nowrap><!--T:14--> You'll need to do this for every git repo you wish to run it on</translate>
cd /path/to/git/repository
~/cmv/bin/commit-message-validator install
# <translate nowrap><!--T:6--> Update to the latest release</translate>
~/cmv/bin/pip install -U commit-message-validator
The git hook will run after you make the commit, and tell you about any errors you might have made so you can go back and amend your change.
External links
- repos/ci-tools/commit-message-validator on GitLab
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.