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.3.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commit_message_validator-2.3.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: commit_message_validator-2.3.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for commit_message_validator-2.3.0.tar.gz
Algorithm Hash digest
SHA256 9d67e8373be8b01c52b1086299158dad8b3418f125d60e76853b9528f9167396
MD5 747985d9174cbd6bb763891dffb8f9a5
BLAKE2b-256 716314e9498fb1d5e80418647227a577ac8139684dd10ba663002a9ec472d90f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for commit_message_validator-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33df1564a182b4558dc3b297cb0fbfb44e43bbc8c0749bff262d8644d70a1a87
MD5 2cb8f6564c6ef75f2a0a7068b063f7cf
BLAKE2b-256 2176161f98623c26047b9717989eeb2db563ad7a5bcd5decbc7d4619022d1833

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page