### Description The actual code is clearly excluding `--no-raise` if `--debug` is set (https://github.com/commitizen-tools/commitizen/blob/master/commitizen/cli.py#L640-L648) ```python if args.debug: logging.getLogger("commitizen").setLevel(logging.DEBUG) sys.excepthook = commitizen_debug_excepthook elif args.no_raise: no_raise_exit_codes = parse_no_raise(args.no_raise) no_raise_debug_excepthook = partial( commitizen_excepthook, no_raise=no_raise_exit_codes ) sys.excepthook = no_raise_debug_excepthook ``` Since `sys.excepthook` is defined here https://github.com/commitizen-tools/commitizen/blob/master/commitizen/cli.py#L564 we can have possible working solution by iteratively precising the partial e.g.: ```python if args.debug: logging.getLogger("commitizen").setLevel(logging.DEBUG) sys.excepthook = commitizen_debug_excepthook if args.no_raise: no_raise_exit_codes = parse_no_raise(args.no_raise) no_raise_debug_excepthook = partial( sys.excepthook, no_raise=no_raise_exit_codes ) sys.excepthook = no_raise_debug_excepthook ``` ### Steps to reproduce `cz --debug --no-raise 21 bump --yes --changelog --dry-run` ### Current behavior The usage of `--debug` prevents the usage of `--no-raise` ### Desired behavior I want to use `--debug` and `--no-raise` together. ### Screenshots _No response_ ### Environment ``` cz version 3.31.0 ```
Activity
bearomorphism commentedon Dec 3, 2025
@Lee-W @woile is there any reason why
elifis used here?The change is introduced in #489
woile commentedon Dec 3, 2025
At the time, I think because it's loading a new hook, it was an elif. But if they could somehow be combined, they it would be ok
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook
fix(cli): debug and no_raise can be used together in sys.excepthook