diff options
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.go | 7 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint_test.go | 23 |
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) |