pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint pkgtools/pkglint: update to 20.1.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a2d4c4b2a335
branches:  trunk
changeset: 414063:a2d4c4b2a335
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Mar 23 19:55:08 2020 +0000

description:
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:

 pkgtools/pkglint/Makefile              |   4 ++--
 pkgtools/pkglint/files/pkglint.go      |   7 +++++++
 pkgtools/pkglint/files/pkglint_test.go |  23 +++++++++++++++++++++++
 3 files changed, 32 insertions(+), 2 deletions(-)

diffs (68 lines):

diff -r 8fbfc6324943 -r a2d4c4b2a335 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Mon Mar 23 19:50:18 2020 +0000
+++ b/pkgtools/pkglint/Makefile Mon Mar 23 19:55:08 2020 +0000
@@ -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 -r 8fbfc6324943 -r a2d4c4b2a335 pkgtools/pkglint/files/pkglint.go
--- a/pkgtools/pkglint/files/pkglint.go Mon Mar 23 19:50:18 2020 +0000
+++ b/pkgtools/pkglint/files/pkglint.go Mon Mar 23 19:55:08 2020 +0000
@@ -441,12 +441,19 @@
                }
        }
 
+       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 -r 8fbfc6324943 -r a2d4c4b2a335 pkgtools/pkglint/files/pkglint_test.go
--- a/pkgtools/pkglint/files/pkglint_test.go    Mon Mar 23 19:50:18 2020 +0000
+++ b/pkgtools/pkglint/files/pkglint_test.go    Mon Mar 23 19:55:08 2020 +0000
@@ -837,6 +837,29 @@
        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)
 



Home | Main Index | Thread Index | Old Index