commit-message-validator
is a tool that validates git commit messages to
the Wikimedia commit message guidelines.
Please see <https://www.mediawiki.org/wiki/commit-message-validator> for more details.
commit-message-validator
can be used as a plugin for the pre-commit git
hooks system. Add the following to your .pre-commit-config.yaml
:
- repo: https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator
rev: # Fill in a tag / sha here (like v2.0.0)
hooks:
- id: commit-message-validator
Then install the pre-commit hook:
pre-commit install --hook-type commit-msg
A GitLab CI/CD template is provided in this repo for linting of commit
messages in a merge request. Add the following to your .gitlab-ci.yml
:
include:
- project: repos/ci-tools/commit-message-validator
file: /templates/lint-merge-request.yml
See CONTRIBUTING.rst for guidelines on contributing to
commit-message-validator
.
Please reports bugs and feature requests at https://phabricator.wikimedia.org/tag/commit-message-validator/.
Licensed under the GPL-2.0-or-later license. See COPYING for the full license.