Skip to content

Commit

Permalink
chore(format): case-insensitive merge commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Oct 21, 2024
1 parent 4093dc9 commit e9301f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conventional_pre_commit/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def is_merge(self, commit_msg: str = ""):
See the documentation, please https://git-scm.com/docs/git-merge.
"""
commit_msg = self.clean(commit_msg)
return commit_msg.startswith("Merge branch ")
return commit_msg.lower().startswith("merge branch ")


class ConventionalCommit(Commit):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def test_has_autosquash_prefix(commit, input, expected_result):
"input,expected_result",
[
("Merge branch '2.x.x' into '1.x.x'", True),
("Merge branch 'dev' into 'main'", True),
("merge branch 'dev' into 'main'", True),
("nope not a merge commit", False),
("type: subject", False),
],
Expand Down

0 comments on commit e9301f5

Please sign in to comment.