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 5.5.5



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f7407da22480
branches:  trunk
changeset: 375696:f7407da22480
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Feb 19 12:40:38 2018 +0000

description:
pkgtools/pkglint: update to 5.5.5

Changes since 5.5.3:

- Removed check for PERL5_PACKLIST, since it was not fixable by the
  package author.

- Completely rewrote the check for ordering variables in simple
  package Makefiles. Now it reports the variables in the correct order
  instead of just saying "this above that" for a few variables.

- Lots of code cleanup and documentation.

diffstat:

 pkgtools/pkglint/Makefile                         |    4 +-
 pkgtools/pkglint/files/autofix.go                 |    9 +-
 pkgtools/pkglint/files/autofix_test.go            |    2 +-
 pkgtools/pkglint/files/buildlink3_test.go         |   26 +-
 pkgtools/pkglint/files/category_test.go           |    2 +-
 pkgtools/pkglint/files/check_test.go              |   20 +-
 pkgtools/pkglint/files/distinfo_test.go           |   10 +-
 pkgtools/pkglint/files/files.go                   |    4 +
 pkgtools/pkglint/files/globaldata.go              |   28 +-
 pkgtools/pkglint/files/globaldata_test.go         |    2 +-
 pkgtools/pkglint/files/mkline.go                  |   50 ++-
 pkgtools/pkglint/files/mkline_test.go             |   73 +++-
 pkgtools/pkglint/files/mklinechecker.go           |   60 +--
 pkgtools/pkglint/files/mklinechecker_test.go      |   43 ++-
 pkgtools/pkglint/files/mklines_test.go            |   42 +-
 pkgtools/pkglint/files/mkparser_test.go           |    4 +-
 pkgtools/pkglint/files/mktypes.go                 |    5 +
 pkgtools/pkglint/files/package.go                 |  334 +++++++++++----------
 pkgtools/pkglint/files/package_test.go            |  198 +++++++++++-
 pkgtools/pkglint/files/patches.go                 |   12 +-
 pkgtools/pkglint/files/patches_test.go            |   44 +-
 pkgtools/pkglint/files/pkglint.go                 |    4 +-
 pkgtools/pkglint/files/pkglint_test.go            |  226 ++++++++++++++-
 pkgtools/pkglint/files/plist.go                   |   11 -
 pkgtools/pkglint/files/plist_test.go              |   46 +--
 pkgtools/pkglint/files/shell.go                   |    8 +-
 pkgtools/pkglint/files/shell_test.go              |    4 +-
 pkgtools/pkglint/files/shtypes.go                 |   26 +-
 pkgtools/pkglint/files/textproc/prefixreplacer.go |    4 +-
 pkgtools/pkglint/files/toplevel.go                |    2 +-
 pkgtools/pkglint/files/toplevel_test.go           |    2 +-
 pkgtools/pkglint/files/vardefs.go                 |   11 +-
 pkgtools/pkglint/files/vartype.go                 |   32 +-
 pkgtools/pkglint/files/vartype_test.go            |    4 +-
 pkgtools/pkglint/files/vartypecheck.go            |    3 +-
 35 files changed, 889 insertions(+), 466 deletions(-)

diffs (truncated from 2876 to 300 lines):

diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/Makefile Mon Feb 19 12:40:38 2018 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.528 2018/01/28 23:21:16 rillig Exp $
+# $NetBSD: Makefile,v 1.529 2018/02/19 12:40:38 rillig Exp $
 
-PKGNAME=       pkglint-5.5.3
+PKGNAME=       pkglint-5.5.5
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/autofix.go
--- a/pkgtools/pkglint/files/autofix.go Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/autofix.go Mon Feb 19 12:40:38 2018 +0000
@@ -160,7 +160,7 @@
        fix.Describef(fix.lines[0].Lineno, "Inserting a line %q before this line.", text)
 }
 
-// InsertBefore appends a line after the current line.
+// InsertAfter appends a line after the current line.
 // The newline is added internally.
 func (fix *Autofix) InsertAfter(text string) {
        if fix.skip() {
@@ -196,14 +196,14 @@
        fix.diagArgs = args
 }
 
-// Notef remembers the warning for logging it later when Apply is called.
+// Warnf remembers the warning for logging it later when Apply is called.
 func (fix *Autofix) Warnf(format string, args ...interface{}) {
        fix.level = llWarn
        fix.diagFormat = format
        fix.diagArgs = args
 }
 
-// Notef remembers the error for logging it later when Apply is called.
+// Errorf remembers the error for logging it later when Apply is called.
 func (fix *Autofix) Errorf(format string, args ...interface{}) {
        fix.level = llError
        fix.diagFormat = format
@@ -215,7 +215,8 @@
        fix.explanation = explanation
 }
 
-// Depending on the pkglint mode, either:
+// Apply does the actual work.
+// Depending on the pkglint mode, it either:
 //
 // * logs the associated message (default)
 // * logs what would be fixed (--show-autofix)
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/autofix_test.go
--- a/pkgtools/pkglint/files/autofix_test.go    Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/autofix_test.go    Mon Feb 19 12:40:38 2018 +0000
@@ -255,7 +255,7 @@
 
        t.SetupCommandLine("--show-autofix", "--source")
        lines := t.SetupFileLinesContinuation("Makefile",
-               MkRcsId,
+               MkRcsID,
                "before \\",
                "The old song \\",
                "after")
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/buildlink3_test.go
--- a/pkgtools/pkglint/files/buildlink3_test.go Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/buildlink3_test.go Mon Feb 19 12:40:38 2018 +0000
@@ -7,7 +7,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "# XXX This file was created automatically using createbuildlink-@PKGVERSION@",
                "",
                "BUILDLINK_TREE+=        Xbae",
@@ -45,7 +45,7 @@
        G.Pkg.EffectivePkgbase = "X11"
        G.Pkg.EffectivePkgnameLine = t.NewMkLine("Makefile", 3, "DISTNAME=\tX11-1.0")
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\ths-X11",
                "",
@@ -70,7 +70,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\tpkgbase1",
                "",
@@ -93,7 +93,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\ths-X11",
                "",
@@ -118,7 +118,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\ths-X11",
                "",
@@ -143,7 +143,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                ".if !defined(HS_X11_BUILDLINK3_MK)",
                "HS_X11_BUILDLINK3_MK:=",
@@ -167,7 +167,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_DEPMETHOD.hs-X11?=\tfull",
                "",
@@ -196,7 +196,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\ths-X11",
                "",
@@ -215,7 +215,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\tpkgbase1",
                "",
@@ -233,7 +233,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+= hs-X11",
                "",
@@ -260,7 +260,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\t${PYPKGPREFIX}-wxWidgets",
                "",
@@ -285,7 +285,7 @@
 
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                "BUILDLINK_TREE+=\t${LICENSE}-wxWidgets",
                "",
@@ -316,7 +316,7 @@
        t.SetupCommandLine("-Wall")
        G.globalData.InitVartypes()
        mklines := t.NewMkLines("buildlink3.mk",
-               MkRcsId,
+               MkRcsID,
                "",
                ".if ${VAAPI_AVAILABLE} == \"yes\"",
                "",
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/category_test.go
--- a/pkgtools/pkglint/files/category_test.go   Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/category_test.go   Mon Feb 19 12:40:38 2018 +0000
@@ -38,7 +38,7 @@
 
        G.globalData.InitVartypes()
        t.SetupFileLines("archivers/Makefile",
-               MkRcsId,
+               MkRcsID,
                "COMMENT=\t\\Make $$$$ fast\"",
                "",
                "SUBDIR+=\tpackage",
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/check_test.go
--- a/pkgtools/pkglint/files/check_test.go      Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/check_test.go      Mon Feb 19 12:40:38 2018 +0000
@@ -18,16 +18,20 @@
 var equals = check.Equals
 var deepEquals = check.DeepEquals
 
-const RcsId = "$" + "NetBSD$"
-const MkRcsId = "# $" + "NetBSD$"
-const PlistRcsId = "@comment $" + "NetBSD$"
+const RcsID = "$" + "NetBSD$"
+const MkRcsID = "# $" + "NetBSD$"
+const PlistRcsID = "@comment $" + "NetBSD$"
 
 type Suite struct {
        Tester *Tester
 }
 
 // Init initializes the suite with the check.C instance for the actual
-// test run. See https://github.com/go-check/check/issues/22
+// test run.
+// The returned tester can be used to easily setup the test environment
+// and check the results using a high-level API.
+//
+// See https://github.com/go-check/check/issues/22
 func (s *Suite) Init(c *check.C) *Tester {
        t := s.Tester // Has been initialized by SetUpTest
        if t.checkC != nil {
@@ -276,18 +280,18 @@
        t.c().Check(emptyToNil(actualLines), deepEquals, emptyToNil(expectedLines))
 }
 
-// BeginDebugToStdout redirects all logging output to stdout instead of
+// EnableTracing redirects all logging output to stdout instead of
 // the buffer. This is useful when stepping through the code, especially
 // in combination with SetupCommandLine("--debug").
-func (t *Tester) BeginDebugToStdout() {
+func (t *Tester) EnableTracing() {
        G.logOut = NewSeparatorWriter(os.Stdout)
        trace.Out = os.Stdout
        trace.Tracing = true
 }
 
-// EndDebugToStdout logs the output to the buffers again, ready to be
+// DisableTracing logs the output to the buffers again, ready to be
 // checked with CheckOutputLines.
-func (t *Tester) EndDebugToStdout() {
+func (t *Tester) DisableTracing() {
        G.logOut = NewSeparatorWriter(&t.stdout)
        trace.Out = &t.stdout
        trace.Tracing = false
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/distinfo_test.go
--- a/pkgtools/pkglint/files/distinfo_test.go   Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/distinfo_test.go   Mon Feb 19 12:40:38 2018 +0000
@@ -34,7 +34,7 @@
        otherLine := t.NewLine("other/distinfo", 7, "dummy")
        G.Hash = map[string]*Hash{"SHA512:pkgname-1.0.tar.gz": {"Some-512-bit-hash", otherLine}}
        lines := t.NewLines("distinfo",
-               RcsId,
+               RcsID,
                "",
                "SHA512 (pkgname-1.0.tar.gz) = 12341234")
 
@@ -49,7 +49,7 @@
        t := s.Init(c)
 
        t.SetupFileLines("patches/patch-aa",
-               RcsId,
+               RcsID,
                "",
                "--- oldfile",
                "+++ newfile",
@@ -59,7 +59,7 @@
        t.SetupFileLines("CVS/Entries",
                "/distinfo/...")
        lines := t.SetupFileLines("distinfo",
-               RcsId,
+               RcsID,
                "",
                "SHA1 (patch-aa) = 5ad1fb9b3c328fff5caa1a23e8f330e707dd50c0")
        G.CurrentDir = t.TmpDir()
@@ -77,7 +77,7 @@
        t.SetupFileLines("patches/patch-aa")
        t.SetupFileLines("patches/patch-src-Makefile")
        lines := t.SetupFileLines("distinfo",
-               RcsId,
+               RcsID,
                "",
                "SHA1 (distfile.tar.gz) = ...",
                "RMD160 (distfile.tar.gz) = ...",
@@ -97,7 +97,7 @@
 
        t.SetupFileLines("patches/manual-libtool.m4")
        lines := t.SetupFileLines("distinfo",
-               RcsId,
+               RcsID,
                "",
                "SHA1 (patch-aa) = ...")
        G.CurrentDir = t.TmpDir()
diff -r 4f6422b7aa75 -r f7407da22480 pkgtools/pkglint/files/files.go
--- a/pkgtools/pkglint/files/files.go   Mon Feb 19 12:10:29 2018 +0000
+++ b/pkgtools/pkglint/files/files.go   Mon Feb 19 12:40:38 2018 +0000
@@ -5,6 +5,10 @@
        "strings"
 )



Home | Main Index | Thread Index | Old Index