Jump to content

commit-message-validator/dtp

From mediawiki.org
This page is a translated version of the page Commit-message-validator and the translation is 13% complete.


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 pre-commit.

Ruhangai lo pointanud kumaa .pre-commit-config.yaml nuː

- repo: https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator
  rev: # Fill in a tag / sha here (like v2.1.0)
  hooks:
    - id: commit-message-validator

Then install the pre-commit hook:

pre-commit install --hook-type commit-msg

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.

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

A GitLab CI/CD template is provided in the project repo for linting of commit messages in a merge request. Ruhangai lo pointanud kumaa .gitlab-ci.yml nuː

include:
  - project: repos/ci-tools/commit-message-validator
    file: /templates/lint-merge-request.yml