Skip to content

Commit 106c294

Browse files
committed
refactor(commands/commit): replace comparison with chained comparison
1 parent 799dc6d commit 106c294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commitizen/commands/commit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def prompt_commit_questions(self) -> str:
6666
message = cz.message(answers)
6767
message_len = len(message.partition("\n")[0].strip())
6868
message_length_limit: int = self.arguments.get("message_length_limit", 0)
69-
if message_length_limit > 0 and message_len > message_length_limit:
69+
if 0 < message_length_limit < message_len:
7070
raise CommitMessageLengthExceededError(
7171
f"Length of commit message exceeds limit ({message_len}/{message_length_limit})"
7272
)

0 commit comments

Comments
 (0)