From e61291707625453f9bd60db122dc372310e5d0a9 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 17 Feb 2025 01:08:13 +0100 Subject: [PATCH] Do not warn about wip packages that have TODO and COMMIT_MSG Suggested by Thomas Klausner via private mail. --- v23/package.go | 3 +++ v23/pkglint_test.go | 12 ++---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/v23/package.go b/v23/package.go index db9a736f..1f3b5a6d 100644 --- a/v23/package.go +++ b/v23/package.go @@ -743,6 +743,9 @@ func (pkg *Package) checkWipCommitMsg() { if !G.Wip { return } + if pkg.File("TODO").IsFile() { + return + } file := pkg.File("COMMIT_MSG") lines := Load(file, NotEmpty) if lines == nil { diff --git a/v23/pkglint_test.go b/v23/pkglint_test.go index e73bd83a..4cfc3fbc 100644 --- a/v23/pkglint_test.go +++ b/v23/pkglint_test.go @@ -1163,11 +1163,7 @@ func (s *Suite) Test_Pkglint_checkReg__readme_and_todo(c *check.C) { t.CheckOutputLines( "ERROR: category/package/TODO: Packages in main pkgsrc must not have a TODO file.", - "WARN: wip/package/COMMIT_MSG: Every work-in-progress "+ - "package should have a COMMIT_MSG file.", - "1 error and 1 warning found.", - "(Run \"pkglint -e category/package wip/package\" "+ - "to show explanations.)", + "1 error found.", ) t.Main("--import", "category/package", "wip/package") @@ -1175,11 +1171,7 @@ func (s *Suite) Test_Pkglint_checkReg__readme_and_todo(c *check.C) { t.CheckOutputLines( "ERROR: category/package/TODO: Packages in main pkgsrc must not have a TODO file.", "ERROR: wip/package/TODO: Must be cleaned up before committing the package.", - "WARN: wip/package/COMMIT_MSG: Every work-in-progress "+ - "package should have a COMMIT_MSG file.", - "2 errors and 1 warning found.", - "(Run \"pkglint -e --import category/package wip/package\" "+ - "to show explanations.)", + "2 errors found.", ) }