Skip to content

Commit cfaea2c

Browse files
committed
docs: add information about no-raise
1 parent 7abdc73 commit cfaea2c

File tree

3 files changed

+66
-14
lines changed

3 files changed

+66
-14
lines changed

docs/README.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,20 @@ Read more about the `check` command [here](check.md).
124124

125125
### Help
126126

127-
```bash
127+
```sh
128128
$ cz --help
129-
usage: cz [-h] [--debug] [-n NAME] [--version]
130-
{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}
131-
...
129+
usage: cz [-h] [--debug] [-n NAME] [-nr NO_RAISE] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...
132130

133131
Commitizen is a cli tool to generate conventional commits.
134132
For more information about the topic go to https://conventionalcommits.org/
135133

136134
optional arguments:
137135
-h, --help show this help message and exit
138136
--debug use debug mode
139-
-n NAME, --name NAME use the given commitizen (default:
140-
cz_conventional_commits)
141-
--version get the version of the installed commitizen
137+
-n NAME, --name NAME use the given commitizen (default: cz_conventional_commits)
138+
-nr NO_RAISE, --no-raise NO_RAISE
139+
comma separated error codes that won't rise error, e.g: cz -nr 1,2,3 bump. See codes at https://commitizen-
140+
tools.github.io/commitizen/exit_codes/
142141
143142
commands:
144143
{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}
@@ -149,12 +148,9 @@ commands:
149148
info show information about the cz
150149
schema show commit schema
151150
bump bump semantic version based on the git log
152-
changelog (ch) generate changelog (note that it will overwrite
153-
existing file)
154-
check validates that a commit message matches the commitizen
155-
schema
156-
version get the version of the installed commitizen or the
157-
current project (default: installed commitizen)
151+
changelog (ch) generate changelog (note that it will overwrite existing file)
152+
check validates that a commit message matches the commitizen schema
153+
version get the version of the installed commitizen or the current project (default: installed commitizen)
158154
```
159155
160156
## Setting up bash completion

docs/bump.md

+56
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,62 @@ Example:
179179
cz bump --changelog --changelog-to-stdout > body.md
180180
```
181181

182+
## Avoid raising errors
183+
184+
Some situations from commitizen rise an exit code different than 0.
185+
If the error code is different than 0, any CI or script running commitizen might be interrupted.
186+
187+
If you have special use case, where you don't want one of this error codes to be raised, you can
188+
tell commitizen to not raise them.
189+
190+
### Recommended use case
191+
192+
At the moment, we've identified that the most common error code to skip is
193+
194+
| Error name | Exit code |
195+
| ----------------- | --------- |
196+
| NoneIncrementExit | 21 |
197+
198+
There are some situations where you don't want to get an error code when some
199+
commits do not match your rules, you just want those commits to be skipped.
200+
201+
```sh
202+
cz -nr 21 bump
203+
```
204+
205+
### Easy way
206+
207+
Check which error code was raised by commitizen by running in the terminal
208+
209+
```sh
210+
echo $?
211+
```
212+
213+
The output should be an integer like this
214+
215+
```sh
216+
3
217+
```
218+
219+
And then you can tell commitizen to ignore it:
220+
221+
```sh
222+
cz --no-raise 3
223+
```
224+
225+
You can tell commitizen to skip more than one if needed:
226+
227+
```sh
228+
cz --no-raise 3,4,5
229+
```
230+
231+
### Longer way
232+
233+
Check the list of [exit_codes](./exit_codes.md) and understand which one you have
234+
to skip and why.
235+
236+
Remember to document somewhere this, because you'll forget.
237+
182238
## Configuration
183239

184240
### `tag_format`

docs/tutorials/github_actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ the new tag, back to your master branch, we have to:
1212
with the following content.
1313

1414
!!! warning
15-
If you use `GITHUB_TOKEN` instead of `PERSONAL_ACCESS_TOKEN`, the job won't trigger another workflow. It's like using `[skip ci]` in other CI's.
15+
If you use `GITHUB_TOKEN` instead of `PERSONAL_ACCESS_TOKEN`, the job won't trigger another workflow. It's like using `[skip ci]` in other CI's.
1616

1717
```yaml
1818
name: Bump version

0 commit comments

Comments
 (0)