Skip to content

Commit 037e08d

Browse files
committed
GitCommitMessageCheck: Allow version to be prefixed with "v"
Closes: #344
1 parent 1d0838b commit 037e08d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/pkgcheck/checks/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def feed(self, commit):
577577
# check for version in summary for singular, non-revision bumps
578578
if len(commit.pkgs['A']) == 1:
579579
atom = next(iter(commit.pkgs['A']))
580-
if not atom.revision and not re.match(rf'^.+\b{re.escape(atom.version)}\b.*$', summary):
580+
if not atom.revision and not re.match(rf'^.+\bv?{re.escape(atom.version)}\b.*$', summary):
581581
error = f'summary missing package version {atom.version!r}'
582582
yield BadCommitSummary(error, summary, commit=commit)
583583
else:

tests/checks/test_git.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ def test_bad_commit_summary_pkg(self):
300300
self.child_repo.create_ebuild('cat/pkg-6-r1')
301301
self.child_git_repo.add_all('cat/pkg: revision bump', signoff=True)
302302
self.init_check()
303+
# allow vVERSION
304+
self.child_repo.create_ebuild('cat/pkg-7')
305+
self.child_git_repo.add_all('cat/pkg: bump to v7', signoff=True)
306+
self.init_check()
303307
results = self.assertReports(self.check, self.source)
304308
r1 = git_mod.BadCommitSummary(
305309
"summary missing 'cat/pkg' package prefix",

0 commit comments

Comments
 (0)