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.2.0.tar.gz (27.5 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.2.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for commit_message_validator-2.2.0.tar.gz
Algorithm Hash digest
SHA256 bba033ac8d39707a59723d4706279cced4a71396e6abc2bb10a92e447baf7af7
MD5 c1a589a607a5041cfc079fe8f8749460
BLAKE2b-256 da1c28668b3fdd1279e6f40b7ac1568c7118bf1421f8645b6edc641a44a81dad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for commit_message_validator-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb057a53bf7b2021240c8ccc11d1822faa589c7b1b5fee25c1f6194081d13475
MD5 fc099e83472decd0209f4d657eb26e3f
BLAKE2b-256 8cc5db4840cfd4f8bb8c3f6809b899cddfdc086d65eeb14232b0df8fad46ced1

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