Skip to content

Commit 5e5778b

Browse files
committed
feat(check): validate non-negative message_length_limit
1 parent f5c4b48 commit 5e5778b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

commitizen/commands/check.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def __init__(self, config: BaseConfig, arguments: CheckArgs, *args: object) -> N
5353
if message_length_limit is not None
5454
else config.settings["message_length_limit"]
5555
)
56+
if self.message_length_limit < 0:
57+
raise InvalidCommandArgumentError(
58+
"message_length_limit must be a non-negative integer"
59+
)
5660

5761
# we need to distinguish between None and [], which is a valid value
5862
allowed_prefixes = arguments.get("allowed_prefixes")

0 commit comments

Comments
 (0)