Skip to content

feat: Ignore fixup! & squash! #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions commitizen/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 2 additions & 0 deletions tests/commands/test_check_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"This reverts commit afc70133e4a81344928561fbf3bb20738dfc8a0b."
),
"feat!: add user stuff",
"fixup! test(commands): ignore fixup! prefix",
"fixup! test(commands): ignore squash! prefix",
]


Expand Down