From 91d0b262a06a609af32816424f25984ef432d16e Mon Sep 17 00:00:00 2001 From: a5r0n <32464596+a5r0n@users.noreply.github.com> Date: Tue, 9 Aug 2022 01:15:28 +0300 Subject: [PATCH 1/2] feat: allow fixup! and squash! in commit messages --- commitizen/commands/check.py | 2 ++ 1 file changed, 2 insertions(+) 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)) From ca35a554203479c36d76533a6f5f767e5da49868 Mon Sep 17 00:00:00 2001 From: a5r0n <32464596+a5r0n@users.noreply.github.com> Date: Tue, 9 Aug 2022 01:21:38 +0300 Subject: [PATCH 2/2] test: Add ignore fixup! & squash! tests --- tests/commands/test_check_command.py | 2 ++ 1 file changed, 2 insertions(+) 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", ]