Skip to content

Commit

Permalink
Fix: Using the regex like this [:-|] is incorrect, because of the spe…
Browse files Browse the repository at this point in the history
…cial purpose of - in a set. Use [:|-] instead
  • Loading branch information
y0urself committed Nov 2, 2021
1 parent a1c534b commit 50479dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pontos/changelog/conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions tests/changelog/test_conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 50479dc

Please sign in to comment.