diff --git a/pontos/changelog/conventional_commits.py b/pontos/changelog/conventional_commits.py index daf5c07ba..ba3756988 100644 --- a/pontos/changelog/conventional_commits.py +++ b/pontos/changelog/conventional_commits.py @@ -86,7 +86,7 @@ def sort_commits(self, commits: List[str]): commit = commit.split(' ', maxsplit=1) for commit_type in commit_types: reg = re.compile( - f'{commit_type["message"]} ?[:-|]', flags=re.I + fr'{commit_type["message"]}\s?[:|-]', flags=re.I ) match = reg.match(commit[1]) if match: diff --git a/tests/changelog/test_conventional_commits.py b/tests/changelog/test_conventional_commits.py index a2c845d14..6c36a9fc9 100644 --- a/tests/changelog/test_conventional_commits.py +++ b/tests/changelog/test_conventional_commits.py @@ -48,6 +48,8 @@ def test_changelog_builder(self): git_log = ( '1234567 Add: foo bar\n' '8abcdef Add: bar baz\n' + '8abcd3f Add bar baz\n' + '8abcd3d Adding bar baz\n' '1337abc Change: bar to baz\n' '42a42a4 Remove: foo bar again\n' 'fedcba8 Test: bar baz testing\n'