summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-03-23 19:55:08 +0000
committerrillig <rillig@pkgsrc.org>2020-03-23 19:55:08 +0000
commit9d2d3f6cda03974e919d04857d54e2e04c3f4101 (patch)
treeab2f7d2ba8a9e9ba7cfa2d615bea513a65a8fcee /pkgtools
parent16b4650764e0762316859c625027cd1fef086b4c (diff)
downloadpkgsrc-9d2d3f6cda03974e919d04857d54e2e04c3f4101.tar.gz
pkgtools/pkglint: update to 20.1.0
Changes since 19.4.13: It is an error to have TODO lines in DESCR files. These are typically generated by url2pkg and should be replaced with proper text before committing the package.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.go7
-rw-r--r--pkgtools/pkglint/files/pkglint_test.go23
3 files changed, 32 insertions, 2 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index e26bd77b960..742ce1041e0 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.637 2020/03/22 17:43:15 rillig Exp $
+# $NetBSD: Makefile,v 1.638 2020/03/23 19:55:08 rillig Exp $
-PKGNAME= pkglint-19.4.13
+PKGNAME= pkglint-20.1.0
CATEGORIES= pkgtools
DISTNAME= tools
MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/}
diff --git a/pkgtools/pkglint/files/pkglint.go b/pkgtools/pkglint/files/pkglint.go
index f40bbdd9823..89dd4479bd4 100644
--- a/pkgtools/pkglint/files/pkglint.go
+++ b/pkgtools/pkglint/files/pkglint.go
@@ -441,12 +441,19 @@ func CheckLinesDescr(lines *Lines) {
}
}
+ checkTodo := func(line *Line) {
+ if hasPrefix(line.Text, "TODO:") {
+ line.Errorf("DESCR files must not have TODO lines.")
+ }
+ }
+
for _, line := range lines.Lines {
ck := LineChecker{line}
ck.CheckLength(80)
ck.CheckTrailingWhitespace()
ck.CheckValidCharacters()
checkVarRefs(line)
+ checkTodo(line)
}
CheckLinesTrailingEmptyLines(lines)
diff --git a/pkgtools/pkglint/files/pkglint_test.go b/pkgtools/pkglint/files/pkglint_test.go
index 217f2b32507..4b26de215cd 100644
--- a/pkgtools/pkglint/files/pkglint_test.go
+++ b/pkgtools/pkglint/files/pkglint_test.go
@@ -837,6 +837,29 @@ func (s *Suite) Test_CheckLinesDescr__variables(c *check.C) {
test("$@", nil...)
}
+func (s *Suite) Test_CheckLinesDescr__TODO(c *check.C) {
+ t := s.Init(c)
+
+ t.SetUpVartypes()
+
+ test := func(text string, diagnostics ...string) {
+ lines := t.NewLines("DESCR",
+ text)
+
+ CheckLinesDescr(lines)
+
+ t.CheckOutput(diagnostics)
+ }
+
+ // See pkgtools/url2pkg/files/url2pkg.py
+ test("TODO: Fill in a short description of the package",
+
+ "ERROR: DESCR:1: DESCR files must not have TODO lines.")
+
+ test("TODO-list is an organizer for everything you need to do, now or later",
+ nil...)
+}
+
func (s *Suite) Test_CheckLinesMessage__one_line_of_text(c *check.C) {
t := s.Init(c)