diff --git a/commitizen/commands/check.py b/commitizen/commands/check.py index eed3ffbb48..58f6814ba3 100644 --- a/commitizen/commands/check.py +++ b/commitizen/commands/check.py @@ -109,6 +109,8 @@ def validate_commit_message(self, commit_msg: str, pattern: str) -> bool: commit_msg.startswith("Merge") or commit_msg.startswith("Revert") or commit_msg.startswith("Pull request") + or commit_msg.startswith("fixup!") + or commit_msg.startswith("squash!") ): return True return bool(re.match(pattern, commit_msg)) diff --git a/tests/commands/test_check_command.py b/tests/commands/test_check_command.py index 6fbbf322cf..c9108dee53 100644 --- a/tests/commands/test_check_command.py +++ b/tests/commands/test_check_command.py @@ -45,6 +45,8 @@ "This reverts commit afc70133e4a81344928561fbf3bb20738dfc8a0b." ), "feat!: add user stuff", + "fixup! test(commands): ignore fixup! prefix", + "fixup! test(commands): ignore squash! prefix", ]