Skip to content

Commit 96fbedb

Browse files
committed
ci: add commit message validation hook
1 parent 0acfab3 commit 96fbedb

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.commitlintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
};

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ repos:
88
rev: v0.8.4
99
hooks:
1010
- id: ruff
11-
- id: ruff-format
11+
- id: ruff-format
12+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
13+
rev: v9.20.0
14+
hooks:
15+
- id: commitlint
16+
stages: [commit-msg]
17+
additional_dependencies: ['@commitlint/config-conventional']

CONTRIBUTING.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Contributing to trame
55
#. Clone the repository using ``git clone``
66
#. Install pre-commit via ``pip install pre-commit``
77
#. Run ``pre-commit install`` to set up pre-commit hooks
8+
#. Run ``pre-commit install --hook-type commit-msg`` to register commit-msg hook
89
#. Make changes to the code, and commit your changes to a separate branch
910
#. Create a fork of the repository on GitHub
1011
#. Push your branch to your fork, and open a pull request

0 commit comments

Comments
 (0)