File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed
Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ [general]
2+ ignore=body-is-missing
3+
4+ [title-max-length]
5+ line-length=72
6+
7+ [title-min-length]
8+ min-length=3
9+
10+ [title-match-regex]
11+ regex=^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+$
Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : local
3+ hooks :
4+ - id : install-dependencies
5+ name : Install dependencies
6+ entry : bash -c 'pip install -r requirements/production.txt'
7+ language : system
8+ always_run : true
9+
10+ - id : gitlint
11+ name : Run gitlint
12+ entry : gitlint
13+ language : python
14+ stages : [commit-msg]
15+ args : [--contrib=CT1, --msg-filename]
16+
17+ - id : pylint
18+ name : Run pylint
19+ entry : pylint
20+ language : python
21+ types : [python]
Original file line number Diff line number Diff line change 1+ ### Pre commit
2+
3+ ## for install dependencies:
4+ ``` shell
5+ pre-commit clean
6+ &&
7+ pre-commit install
8+ &&
9+ pre-commit install --hook-type commit-msg
10+ ```
11+
12+ ## for applying new added rule:
13+ ``` shell
14+ pre-commit clean &&
15+ pre-commit install Or pre-commit install --hook-type commit-msg
16+ ```
17+
18+ ## running pre-commit for test
19+ ``` shell
20+ pre-commit run --all-files
21+ ```
22+
23+ ## testing gitlint
24+ ``` shell
25+ echo " bad commit message" > test_commit_msg.txt
26+ &&
27+ gitlint --msg-filename test_commit_msg.txt
28+ ```
29+
30+ ## Or:
31+ ``` shell
32+ pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
33+ ```
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ django-redis==5.4.0
55djangorestframework==3.15.2
66drf-spectacular==0.28.0
77pylint==3.3.2
8+ pre-commit==4.0.1
9+ gitlint==0.19.1
Original file line number Diff line number Diff line change 1+ bad commit message
You can’t perform that action at this time.
0 commit comments