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 19.3.8



details:   https://anonhg.NetBSD.org/pkgsrc/rev/66c5e4116d8f
branches:  trunk
changeset: 344163:66c5e4116d8f
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Nov 17 02:06:01 2019 +0000

description:
pkgtools/pkglint: update to 19.3.8

Changes since 19.3.7:

Made check for doc/CHANGES file stricter. The check now catches entries
for added packages that are missing the word "version".

diffstat:

 pkgtools/pkglint/Makefile                      |   4 ++--
 pkgtools/pkglint/files/intqa/testnames_test.go |  23 +++++++++++++++++++++--
 pkgtools/pkglint/files/pkgsrc.go               |   2 +-
 pkgtools/pkglint/files/pkgsrc_test.go          |   3 +++
 4 files changed, 27 insertions(+), 5 deletions(-)

diffs (84 lines):

diff -r 58b52182aa32 -r 66c5e4116d8f pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Nov 17 02:03:40 2019 +0000
+++ b/pkgtools/pkglint/Makefile Sun Nov 17 02:06:01 2019 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.607 2019/11/17 01:26:25 rillig Exp $
+# $NetBSD: Makefile,v 1.608 2019/11/17 02:06:01 rillig Exp $
 
-PKGNAME=       pkglint-19.3.7
+PKGNAME=       pkglint-19.3.8
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}
diff -r 58b52182aa32 -r 66c5e4116d8f pkgtools/pkglint/files/intqa/testnames_test.go
--- a/pkgtools/pkglint/files/intqa/testnames_test.go    Sun Nov 17 02:03:40 2019 +0000
+++ b/pkgtools/pkglint/files/intqa/testnames_test.go    Sun Nov 17 02:06:01 2019 +0000
@@ -47,6 +47,26 @@
        s.summary = ""
 }
 
+func (s *Suite) Test_TestNameChecker_Enable(c *check.C) {
+       ck := s.Init(c)
+
+       ck.Enable(ENone) // overwrite initialization from Suite.Init
+
+       c.Check(ck.errorsMask, check.Equals, uint64(0))
+
+       ck.Enable(EAll)
+
+       c.Check(ck.errorsMask, check.Equals, ^uint64(0))
+
+       ck.Enable(ENone, EMissingTest)
+
+       c.Check(ck.errorsMask, check.Equals, uint64(4))
+
+       ck.Enable(EAll, -EMissingTest)
+
+       c.Check(ck.errorsMask, check.Equals, ^uint64(0)^4)
+}
+
 func (s *Suite) Test_TestNameChecker_Check(c *check.C) {
        ck := s.Init(c)
 
@@ -55,7 +75,6 @@
        s.CheckErrors(
                "Missing unit test \"Test_NewTestNameChecker\" for \"NewTestNameChecker\".",
                "Missing unit test \"Test_TestNameChecker_IgnoreFiles\" for \"TestNameChecker.IgnoreFiles\".",
-               "Missing unit test \"Test_TestNameChecker_Enable\" for \"TestNameChecker.Enable\".",
                "Missing unit test \"Test_TestNameChecker_load\" for \"TestNameChecker.load\".",
                "Missing unit test \"Test_TestNameChecker_loadDecl\" for \"TestNameChecker.loadDecl\".",
                "Missing unit test \"Test_TestNameChecker_addCode\" for \"TestNameChecker.addCode\".",
@@ -72,7 +91,7 @@
                "Missing unit test \"Test_Suite_CheckErrors\" for \"Suite.CheckErrors\".",
                "Missing unit test \"Test_Suite_CheckSummary\" for \"Suite.CheckSummary\".",
                "Missing unit test \"Test_Value_Method\" for \"Value.Method\".")
-       s.CheckSummary("19 errors.")
+       s.CheckSummary("18 errors.")
 }
 
 func (s *Suite) Test_TestNameChecker_addTest(c *check.C) {
diff -r 58b52182aa32 -r 66c5e4116d8f pkgtools/pkglint/files/pkgsrc.go
--- a/pkgtools/pkglint/files/pkgsrc.go  Sun Nov 17 02:03:40 2019 +0000
+++ b/pkgtools/pkglint/files/pkgsrc.go  Sun Nov 17 02:06:01 2019 +0000
@@ -269,7 +269,7 @@
 
        f := strings.Fields(lex.Rest())
        n := len(f)
-       if n != 4 && n != 6 {
+       if n < 4 || n > 6 {
                return nil
        }
 
diff -r 58b52182aa32 -r 66c5e4116d8f pkgtools/pkglint/files/pkgsrc_test.go
--- a/pkgtools/pkglint/files/pkgsrc_test.go     Sun Nov 17 02:03:40 2019 +0000
+++ b/pkgtools/pkglint/files/pkgsrc_test.go     Sun Nov 17 02:06:01 2019 +0000
@@ -355,6 +355,9 @@
        test("\tAdded something [author date]",
                "WARN: doc/CHANGES-2019:123: Unknown doc/CHANGES line: \tAdded something [author date]")
 
+       test("\tAdded category/package 1.0 [author 2019-11-17]",
+               "WARN: doc/CHANGES-2019:123: Unknown doc/CHANGES line: \tAdded category/package 1.0 [author 2019-11-17]")
+
        test("\t\tToo large indentation",
                "WARN: doc/CHANGES-2019:123: Package changes should be indented using a single tab, not \"\\t\\t\".")
        test("\t Too large indentation",



Home | Main Index | Thread Index | Old Index