Skip to content

Commit 5521331

Browse files
committed
fix: change error code for NoneIncrementExit
1 parent f429a68 commit 5521331

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

commitizen/cli.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,16 @@ def parse_no_raise(comma_separated_no_raise: str) -> List[int]:
314314
Convert the given string with exit code digits or exit
315315
codes name to its integer representation
316316
"""
317-
no_raise_items = comma_separated_no_raise.split(",")
317+
no_raise_items: List[str] = comma_separated_no_raise.split(",")
318318
no_raise_codes = []
319319
for item in no_raise_items:
320320
if item.isdecimal():
321321
no_raise_codes.append(int(item))
322322
continue
323323
try:
324-
exit_code = ExitCode[item]
324+
exit_code = ExitCode[item.strip()]
325325
except KeyError:
326-
out.warn(f"WARN: no_raise key {item} does not exist. Skipping.")
326+
out.warn(f"WARN: no_raise key `{item}` does not exist. Skipping.")
327327
continue
328328
else:
329329
no_raise_codes.append(exit_code.value)

commitizen/exceptions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ExitCode(enum.IntEnum):
2525
INVALID_COMMAND_ARGUMENT = 18
2626
INVALID_CONFIGURATION = 19
2727
NOT_ALLOWED = 20
28+
NO_INCREMENT = 21
2829

2930

3031
class CommitizenException(Exception):
@@ -56,7 +57,7 @@ class DryRunExit(ExpectedExit):
5657

5758

5859
class NoneIncrementExit(CommitizenException):
59-
exit_code = ExitCode.NO_COMMITS_FOUND
60+
exit_code = ExitCode.NO_INCREMENT
6061

6162

6263
class NoCommitizenFoundException(CommitizenException):

0 commit comments

Comments
 (0)