Skip to content

Commit a92dbdc

Browse files
docs(exit_codes): note that --no-raise must precede the subcommand (#1955)
`--no-raise` / `-nr` is registered on the top-level parser, so it must appear before the subcommand (e.g. `cz -nr 21 bump`). Placing it after the subcommand falls into the unknown-args validator in `commitizen/cli.py` and exits with code 18 (`InvalidCommandArgumentError`) and the message: Invalid commitizen arguments were found: `--no-raise`. Please use -- separator for extra git args All existing examples in `docs/exit_codes.md` already follow the correct placement, but the constraint is never stated explicitly. Two recent PRs (commitizen #1950 and setup-cz #17) got it wrong despite the docs being clear by example, breaking the bump workflow. Add an admonition right after the flag introduction so the rule is impossible to miss. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4328b5e commit a92dbdc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

docs/exit_codes.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ The `--no-raise` (or `-nr`) flag allows you to specify exit codes that should no
5757

5858
Multiple exit codes can be specified as a comma-separated list.
5959

60+
!!! warning "Flag placement"
61+
`--no-raise` / `-nr` is a **top-level Commitizen flag**, so it must be passed
62+
**before** the subcommand:
63+
64+
```sh
65+
cz --no-raise 21 bump --yes # ✅ correct
66+
cz -nr 21 bump --yes # ✅ correct (short form)
67+
```
68+
69+
Placing it after the subcommand fails with exit code 18
70+
(`InvalidCommandArgumentError`):
71+
72+
```sh
73+
cz bump --yes --no-raise 21 # ❌ wrong
74+
# Invalid commitizen arguments were found: `--no-raise`.
75+
# Please use -- separator for extra git args
76+
```
77+
6078
### Common Use Cases
6179

6280
#### Ignoring No Increment Errors

0 commit comments

Comments
 (0)