Skip to content

Commit 32287f0

Browse files
committed
docs: exit codes
1 parent a3af3a9 commit 32287f0

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/exit_codes.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Exit Codes
2+
3+
Commitizen handles expected exceptions through `CommitizenException` and returns different exit codes for different situations. They could be useful if you want to ignore specific errors in your pipeline.
4+
5+
These exit codes can be found in `commitizen/exceptions.py::ExitCode`.
6+
7+
| Exception | Exit Code | Description |
8+
| --------- | --------- | ----------- |
9+
| ExpectedExit | 0 | Expected exit |
10+
| DryRunExit | 0 | Exit due to passing `--dry-run` option |
11+
| NoCommitizenFoundException | 1 | Using a cz (e.g., `cz_jira`) that cannot be found in your system |
12+
| NotAGitProjectError | 2 | Not in a git project |
13+
| NoCommitsFoundError | 4 | No commit found |
14+
| NoVersionSpecifiedError | 4 | Version can not be found in configuration file |
15+
| NoPatternMapError | 5 | bump / changelog pattern or map can not be found in configuration file |
16+
| BumpCommitFailedError | 6 | Commit error when bumping version |
17+
| BumpTagFailedError | 7 | Tag error when bumping version |
18+
| NoAnswersError | 8 | No user response given |
19+
| CommitError | 9 | git commit error |
20+
| NoCommitBackupError | 10 | Commit back up file cannot be found |
21+
| NothingToCommitError | 11 | Nothing in staging to be committed |
22+
| CustomError | 12 | `CzException` raised |
23+
| NoCommandFoundError | 13 | No command found when running commitizen cli (e.g., `cz --debug`) |
24+
| InvalidCommitMessageError | 14 | The commit message does not pass `cz check` |
25+
| MissingConfigError | 15 | Configuration missed for `cz_customize` |
26+
| NoRevisionError | 16 | No revision found |
27+
| CurrentVersionNotFoundError | 17 | current version cannot be found in *version_files* |
28+
| InvalidCommandArgumentError | 18 | The argument provide to command is invalid (e.g. `cz check -commit-msg-file filename --rev-range master..`) |

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ nav:
2121
- Writing commits: 'tutorials/writing_commits.md'
2222
- GitLab CI: 'tutorials/gitlab_ci.md'
2323
- Github Actions: 'tutorials/github_actions.md'
24+
- Exit Codes: 'exit_codes.md'
2425
- Third-Party Commitizen Templates: 'third-party-commitizen.md'
2526
- Contributing: 'contributing.md'
2627

0 commit comments

Comments
 (0)