Skip to content

Commit 3c1106a

Browse files
Merge pull request #152 from elliottmurray/style/git_message
fix: script up to search branches
2 parents 3f9cc6f + 92491be commit 3c1106a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

script/commit_message.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414

1515
def main():
1616

17-
cmd = "git log --pretty=format:'%s' master..HEAD"
17+
cmd_tag = "git describe --abbrev=0"
18+
tag = subprocess.check_output(cmd_tag,
19+
shell=True).decode("utf-8").split('\n')[0]
20+
21+
cmd = "git log --pretty=format:'%s' {}..master".format(tag)
1822
commits = subprocess.check_output(cmd, shell=True)
1923
commits = commits.decode("utf-8").split('\n')
2024
for commit in commits:
2125

22-
pattern = r'((build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*)|((Merge)(\([\w\-]+\))?\s.*)' # noqa
26+
pattern = r'((build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert)(\([\w\-]+\))?:\s.*)|((Merge|Fixed)(\([\w\-]+\))?\s.*)' # noqa
2327
m = re.match(pattern, commit)
2428
if m is None:
2529
print("\nError with git message '{}' style".format(commit))

0 commit comments

Comments
 (0)