Metadata-Version: 2.4
Name: commit-message-validator
Version: 2.2.0
Summary: Validate the format of a commit message to Wikimedia Gerrit standards
Project-URL: Documentation, https://www.mediawiki.org/wiki/commit-message-validator
Project-URL: Changelog, https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator/-/blob/main/HISTORY.rst
Project-URL: Bug tracker, https://phabricator.wikimedia.org/tag/commit-message-validator/
Project-URL: Source code, https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator
Author-email: Bryan Davis <bd808@wikimedia.org>, Kunal Mehta <Legoktm@debian.org>
Maintainer-email: Bryan Davis <bd808@wikimedia.org>, Kunal Mehta <Legoktm@debian.org>
License-Expression: GPL-2.0-or-later
License-File: COPYING
Keywords: gerrit,git,lint,wikimedia
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.6
Requires-Dist: click-aliases==1.0.4
Requires-Dist: click-option-group==0.5.6
Requires-Dist: click==8.1.7
Requires-Dist: importlib-metadata==6.7.0; python_version < '3.8'
Description-Content-Type: text/x-rst

########################
Commit Message Validator
########################

``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``:

.. code-block:: 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:

.. code-block:: bash

   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``:

.. code-block:: yaml

   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.

.. _Wikimedia commit message guidelines: https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines
.. _pre-commit: https://pre-commit.com/
.. _CONTRIBUTING.rst: https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator/-/blob/main/CONTRIBUTING.rst
.. _GPL-2.0-or-later: https://www.gnu.org/licenses/gpl-2.0.html
.. _COPYING: https://gitlab.wikimedia.org/repos/ci-tools/commit-message-validator/-/blob/main/COPYING
