Skip to content

Commit

Permalink
fix: strip the commit message for calculating length
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin1kevin1k authored and Lee-W committed Apr 30, 2024
1 parent 432431e commit 83cf451
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commitizen/commands/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def prompt_commit_questions(self) -> str:
raise NoAnswersError()

message = cz.message(answers)
message_len = len(message.partition("\n")[0])
message_len = len(message.partition("\n")[0].strip())
message_length_limit: int = self.arguments.get("message_length_limit", 0)
if message_length_limit > 0 and message_len > message_length_limit:
raise CommitMessageLengthExceededError(
Expand Down

0 comments on commit 83cf451

Please sign in to comment.