Skip to main content

Validate the format of a commit message to Wikimedia Gerrit standards

Project description

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.

Usage

Use locally as a Pre-commit plugin

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

Use with gitlab.wikimedia.org’s CI/CD

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

Contributing

See CONTRIBUTING.rst for guidelines on contributing to commit-message-validator.

Bug reports

Please reports bugs and feature requests at https://phabricator.wikimedia.org/tag/commit-message-validator/.

License

Licensed under the GPL-2.0-or-later license. See COPYING for the full license.

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

commit_message_validator-2.0.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

commit_message_validator-2.0.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file commit_message_validator-2.0.0.tar.gz.

File metadata

File hashes

Hashes for commit_message_validator-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5d718cd271a2dfd06a4473e126dec9065134429e4f9dd37b90dad441a85431f0
MD5 efd003ed5d006b27bebdfea029f94c5e
BLAKE2b-256 8dffc4c44521c83d2edce2492113e7ae9b6fdb993cadec628056f1b581f7b810

See more details on using hashes here.

File details

Details for the file commit_message_validator-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for commit_message_validator-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ece3d7bac71f1becc90d817c5276401149804a66851153baa3f651c5fa46dc03
MD5 36ec0347298f81855b72e4713ad949b8
BLAKE2b-256 7bf55dc9e34e09530922c3643cc9bc1b02ff52423ef0d7a262465d6e6fc3b0c6

See more details on using hashes here.

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