Skip to content

Commit a549404

Browse files
committed
Improve comment and pattern matching
1 parent 4b6958f commit a549404

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/check_version_in_changelog.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
with open(CHANGELOG_PATH, encoding='utf-8') as changelog_file:
1717
for line in changelog_file:
18-
# The heading for the changelog entry for the given version can start with either the version number,
19-
# or the version number in a link
20-
if re.match(rf'(## )\[?{current_package_version}([\] ]|$)', line):
18+
# Ensure that the heading in the changelog entry for the specified version includes a version number
19+
# enclosed in square brackets. This version number is formatted as a link to the corresponding
20+
# version tag on GitHub.
21+
if re.match(rf'## \[{current_package_version}\].*$', line):
2122
break
2223
else:
2324
raise RuntimeError(

0 commit comments

Comments
 (0)