Skip to content

Commit 48e379f

Browse files
committed
BadCommitSummary: only allow "cat/pn: " prefixes
Instead of also allowing "cat/pn-pv: " to match the warning message and make the subsequent version string check more relevant.
1 parent 15cff72 commit 48e379f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pkgcheck/checks/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,13 @@ def feed(self, commit):
571571
if len({x.package for x in atoms}) == 1:
572572
# changes to a single cat/pn
573573
atom = next(iter(atoms))
574-
if not re.match(rf'^({re.escape(atom.key)}|{re.escape(atom.cpvstr)}): ', summary):
574+
if not re.match(rf'^{re.escape(atom.key)}: ', summary):
575575
error = f'summary missing {atom.key!r} package prefix'
576576
yield BadCommitSummary(error, summary, commit=commit)
577577
# check for version in summary for singular version bumps
578578
if len(commit.pkgs['A']) == 1:
579579
version = next(iter(commit.pkgs['A'])).version
580-
if not re.match(rf'^.+\b{version}\b.*$', summary):
580+
if not re.match(rf'^.+\b{re.escape(version)}\b.*$', summary):
581581
error = f'summary missing package version {version!r}'
582582
yield BadCommitSummary(error, summary, commit=commit)
583583
else:

0 commit comments

Comments
 (0)