From d67ee8edbc703baed51be2974b55791ecdd97cae Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 5 Oct 2023 16:50:14 +0200 Subject: [PATCH] ci: add configuration for commitlint --- .pre-commit-config.yaml | 1 + commitlint.config.js | 4 +++- docs/development_environment.rst | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d181701..36b2d2e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,4 +36,5 @@ repos: rev: v9.5.0 hooks: - id: commitlint + additional_dependencies: ['@commitlint/config-conventional'] stages: [commit-msg] diff --git a/commitlint.config.js b/commitlint.config.js index 8174613e..44e437c4 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -3,6 +3,8 @@ module.exports = { extends: ['@commitlint/config-conventional'], rules: { - 'body-max-line-length': [2, 'always', '*'], + 'body-max-line-length': [2, 'always', Infinity], + 'subject-case': [0, 'always', 'lower-case'], + 'body-case': [0, 'always', 'lower-case'], }, }; diff --git a/docs/development_environment.rst b/docs/development_environment.rst index d05c9039..7f06bb13 100644 --- a/docs/development_environment.rst +++ b/docs/development_environment.rst @@ -53,8 +53,13 @@ To get flake8 and tox, just pip install them into your virtualenv. 7. Commit your changes and push your branch to GitHub: We follow the conventionalcommit_ standards for commit message During the pre-commit phase we will validate the commit message + You have to install the hook with the following command: -.. _conventionalcommit : https://www.conventionalcommits.org/en/v1.0.0/ +.. code-block:: console + + pre-commit install --hook-type commit-msg + +.. _conventionalcommit : https://www.conventionalcommits.org/en/v1.0.0/ .. code-block:: console