File tree Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 1515 rev : v2.31.0 # automatically updated by Commitizen
1616 hooks :
1717 - id : commitizen
18- stages : [commit-msg]
1918
2019 - repo : local
2120 hooks :
Original file line number Diff line number Diff line change 11- id : commitizen
22 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.
47 entry : cz check
58 args : [--allow-abort, --commit-msg-file]
69 stages : [commit-msg]
710 language : python
811 language_version : python3
912 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
101101```
102102
103103### 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 ` .
105105You can integrate this in your [ pre-commit] ( https://pre-commit.com/ ) config with:
106106
107107``` yaml
@@ -111,14 +111,23 @@ repos:
111111 rev : master
112112 hooks :
113113 - id : commitizen
114+ - id : commitizen-branch
115+ stages : [push]
114116` ` `
115117
116- After the configuration is added, you'll need to run
118+ After the configuration is added, you'll need to run:
117119
118120` ` ` sh
119- pre-commit install --hook-type commit-msg
121+ pre-commit install --hook-type commit-msg pre-push
120122```
121123
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+
122131Read more about the ` check ` command [ here] ( check.md ) .
123132
124133### Help
You can’t perform that action at this time.
0 commit comments