File tree 2 files changed +31
-4
lines changed
2 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 1
1
- id : commitizen
2
2
name : commitizen check
3
- description : " Check whether the commit message follows commiting rules"
3
+ description : >
4
+ Check whether the current commit message follows commiting rules. Allow
5
+ empty commit messages by default, because they typically indicate to Git
6
+ that the commit should be aborted.
4
7
entry : cz check
5
8
args : [--allow-abort, --commit-msg-file]
6
9
stages : [commit-msg]
7
10
language : python
8
11
language_version : python3
9
12
minimum_pre_commit_version : " 1.4.3"
13
+
14
+ - id : commitizen-branch
15
+ name : commitizen check branch
16
+ description : >
17
+ Check all commit messages that are already on the current branch but not the
18
+ default branch on the origin repository. Useful for checking messages after
19
+ the fact (e.g., pre-push or in CI) without an expensive check of the entire
20
+ repository history.
21
+ entry : cz check
22
+ args : [--rev-range, origin/HEAD..HEAD]
23
+ always_run : true
24
+ pass_filenames : false
25
+ language : python
26
+ language_version : python3
27
+ minimum_pre_commit_version : " 1.4.3"
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ cz commit -s
101
101
```
102
102
103
103
### Integrating with Pre-commit
104
- Commitizen can lint your commit message for you with ` cz check ` .
104
+ Commitizen can lint your commit messages for you with ` cz check ` .
105
105
You can integrate this in your [ pre-commit] ( https://pre-commit.com/ ) config with:
106
106
107
107
``` yaml
@@ -111,14 +111,23 @@ repos:
111
111
rev : master
112
112
hooks :
113
113
- id : commitizen
114
+ - id : commitizen-branch
115
+ stages : [push]
114
116
` ` `
115
117
116
- After the configuration is added, you'll need to run
118
+ After the configuration is added, you'll need to run:
117
119
118
120
` ` ` sh
119
- pre-commit install --hook-type commit-msg
121
+ pre-commit install --hook-type commit-msg pre-push
120
122
```
121
123
124
+ If you aren't using both hooks, you needn't install both stages.
125
+
126
+ | Hook | Recommended Stage |
127
+ | ----------------- | ----------------- |
128
+ | commitizen | commit-msg |
129
+ | commitizen-branch | pre-push |
130
+
122
131
Read more about the ` check ` command [ here] ( check.md ) .
123
132
124
133
### Help
You can’t perform that action at this time.
0 commit comments