Skip to content

Commit bc9be40

Browse files
committed
feat: skip merge messages that start with Pull request
Bitbucket add as default message when a pull request is merged, the message commit that starts with "Pull request". cz check fails with this kind of messages. Signed-off-by: Angelo Mantellini <[email protected]>
1 parent 27b4c54 commit bc9be40

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

commitizen/commands/check.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def _filter_comments(self, msg: str) -> str:
100100

101101
@staticmethod
102102
def validate_commit_message(commit_msg: str, pattern: str) -> bool:
103-
if commit_msg.startswith("Merge") or commit_msg.startswith("Revert"):
103+
if (
104+
commit_msg.startswith("Merge")
105+
or commit_msg.startswith("Revert")
106+
or commit_msg.startswith("Pull request")
107+
):
104108
return True
105109
return bool(re.match(pattern, commit_msg))

commitizen/config/toml_config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _parse_setting(self, data: Union[bytes, str]) -> None:
4949
name = "cz_conventional_commits"
5050
```
5151
"""
52-
doc = parse(data) # type: ignore
52+
doc = parse(data)
5353
try:
5454
self.settings.update(doc["tool"]["commitizen"]) # type: ignore
5555
except exceptions.NonExistentKey:

0 commit comments

Comments
 (0)