From c9281bd90d8cc2e0ad286826b5cb025da5603c2c Mon Sep 17 00:00:00 2001 From: Tim Hsiung Date: Sat, 9 May 2026 14:13:42 +0800 Subject: [PATCH] docs(exit_codes): note that --no-raise must precede the subcommand `--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> --- docs/exit_codes.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/exit_codes.md b/docs/exit_codes.md index 1a214e2832..f99115ed31 100644 --- a/docs/exit_codes.md +++ b/docs/exit_codes.md @@ -57,6 +57,24 @@ The `--no-raise` (or `-nr`) flag allows you to specify exit codes that should no Multiple exit codes can be specified as a comma-separated list. +!!! warning "Flag placement" + `--no-raise` / `-nr` is a **top-level Commitizen flag**, so it must be passed + **before** the subcommand: + + ```sh + cz --no-raise 21 bump --yes # ✅ correct + cz -nr 21 bump --yes # ✅ correct (short form) + ``` + + Placing it after the subcommand fails with exit code 18 + (`InvalidCommandArgumentError`): + + ```sh + cz bump --yes --no-raise 21 # ❌ wrong + # Invalid commitizen arguments were found: `--no-raise`. + # Please use -- separator for extra git args + ``` + ### Common Use Cases #### Ignoring No Increment Errors