Skip to content

Commit 83cf451

Browse files
kevin1kevin1kLee-W
authored andcommitted
fix: strip the commit message for calculating length
1 parent 432431e commit 83cf451

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
@@ -64,7 +64,7 @@ def prompt_commit_questions(self) -> str:
6464
raise NoAnswersError()
6565

6666
message = cz.message(answers)
67-
message_len = len(message.partition("\n")[0])
67+
message_len = len(message.partition("\n")[0].strip())
6868
message_length_limit: int = self.arguments.get("message_length_limit", 0)
6969
if message_length_limit > 0 and message_len > message_length_limit:
7070
raise CommitMessageLengthExceededError(

0 commit comments

Comments
 (0)