Skip to content

Commit

Permalink
Do not warn about wip packages that have TODO and COMMIT_MSG
Browse files Browse the repository at this point in the history
Suggested by Thomas Klausner via private mail.
  • Loading branch information
rillig committed Feb 17, 2025
1 parent f664981 commit e612917
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 3 additions & 0 deletions v23/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 2 additions & 10 deletions v23/pkglint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,23 +1163,15 @@ 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")

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.",
)
}

Expand Down

0 comments on commit e612917

Please sign in to comment.