pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Updated pkglint to 5.4.4.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8b737e01c575
branches:  trunk
changeset: 349498:8b737e01c575
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 09 09:43:48 2016 +0000

description:
Updated pkglint to 5.4.4.

Changes since 5.4.3:

* Improved detection for undocumented patches from Git
* Added warning about unnecessary space after variable names
* Lots of internal housekeeping

diffstat:

 pkgtools/pkglint/Makefile                   |    4 +-
 pkgtools/pkglint/files/buildlink3_test.go   |   24 +-
 pkgtools/pkglint/files/category_test.go     |    4 +-
 pkgtools/pkglint/files/dir_test.go          |    4 +-
 pkgtools/pkglint/files/distinfo_test.go     |   10 +-
 pkgtools/pkglint/files/expecter.go          |    4 +-
 pkgtools/pkglint/files/files_test.go        |   12 +-
 pkgtools/pkglint/files/getopt_test.go       |   12 +-
 pkgtools/pkglint/files/globaldata.go        |    6 +-
 pkgtools/pkglint/files/globaldata_test.go   |   10 +-
 pkgtools/pkglint/files/licenses_test.go     |    4 +-
 pkgtools/pkglint/files/line.go              |   21 +-
 pkgtools/pkglint/files/line_test.go         |   30 +-
 pkgtools/pkglint/files/main_test.go         |    8 +-
 pkgtools/pkglint/files/mkline.go            |  110 +++----
 pkgtools/pkglint/files/mkline_test.go       |  184 +++++++----
 pkgtools/pkglint/files/mklines.go           |    5 +
 pkgtools/pkglint/files/mklines_test.go      |  115 ++++++-
 pkgtools/pkglint/files/mkparser.go          |   12 +-
 pkgtools/pkglint/files/mkshtypes.go         |    2 +-
 pkgtools/pkglint/files/mkshwalker.go        |   30 +-
 pkgtools/pkglint/files/package.go           |    2 +-
 pkgtools/pkglint/files/package_test.go      |   81 +---
 pkgtools/pkglint/files/parser_test.go       |   27 +-
 pkgtools/pkglint/files/patches.go           |   12 +-
 pkgtools/pkglint/files/patches_test.go      |   54 ++-
 pkgtools/pkglint/files/pkglint.go           |    3 +-
 pkgtools/pkglint/files/pkglint_test.go      |  103 +-----
 pkgtools/pkglint/files/plist_test.go        |   16 +-
 pkgtools/pkglint/files/shell.go             |    4 +-
 pkgtools/pkglint/files/shell_test.go        |   54 +-
 pkgtools/pkglint/files/shtokenizer.go       |  103 ++----
 pkgtools/pkglint/files/shtokenizer_test.go  |   40 +-
 pkgtools/pkglint/files/shtypes.go           |   40 +--
 pkgtools/pkglint/files/substcontext_test.go |    8 +-
 pkgtools/pkglint/files/toplevel_test.go     |    2 +-
 pkgtools/pkglint/files/tree_test.go         |    2 +-
 pkgtools/pkglint/files/util.go              |   46 +-
 pkgtools/pkglint/files/util_test.go         |   20 +-
 pkgtools/pkglint/files/vardefs.go           |   34 +-
 pkgtools/pkglint/files/vartype.go           |    2 +-
 pkgtools/pkglint/files/vartype_test.go      |   16 +-
 pkgtools/pkglint/files/vartypecheck.go      |  415 +++++++++++++--------------
 pkgtools/pkglint/files/vartypecheck_test.go |   76 ++--
 pkgtools/pkglint/files/vercmp_test.go       |    4 +-
 45 files changed, 878 insertions(+), 897 deletions(-)

diffs (truncated from 4937 to 300 lines):

diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/Makefile Sat Jul 09 09:43:48 2016 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.488 2016/07/07 12:09:26 rillig Exp $
+# $NetBSD: Makefile,v 1.489 2016/07/09 09:43:48 rillig Exp $
 
-PKGNAME=       pkglint-5.4.3
+PKGNAME=       pkglint-5.4.4
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/buildlink3_test.go
--- a/pkgtools/pkglint/files/buildlink3_test.go Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/buildlink3_test.go Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestChecklinesBuildlink3(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -37,7 +37,7 @@
 // Before version 5.3, pkglint wrongly warned here.
 // The mk/haskell.mk file takes care of constructing the correct PKGNAME,
 // but pkglint had not looked at that file.
-func (s *Suite) TestChecklinesBuildlink3_NameMismatch(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_name_mismatch(c *check.C) {
        G.globalData.InitVartypes()
        G.Pkg = NewPackage("x11/hs-X11")
        G.Pkg.EffectivePkgbase = "X11"
@@ -62,7 +62,7 @@
        c.Check(s.Output(), equals, "ERROR: buildlink3.mk:3: Package name mismatch between \"hs-X11\" in this file and \"X11\" from Makefile:3.\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_NameMismatchMultipleInclusion(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_name_mismatch_multiple_inclusion(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -83,7 +83,7 @@
                "WARN: buildlink3.mk:9: Definition of BUILDLINK_API_DEPENDS is missing.\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_NameMismatchAbiApi(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_name_mismatch_abi_api(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -105,7 +105,7 @@
        c.Check(s.Output(), equals, "WARN: buildlink3.mk:9: Package name mismatch between ABI \"hs-X12\" and API \"hs-X11\" (from line 8).\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_AbiApiVersions(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_abi_api_versions(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -128,7 +128,7 @@
                "WARN: buildlink3.mk:9: ABI version \"1.6.0\" should be at least API version \"1.6.1\" (see line 8).\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_NoBuildlinkTreeAtBeginning(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_no_BUILDLINK_TREE_at_beginning(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -149,7 +149,7 @@
        c.Check(s.Output(), equals, "WARN: buildlink3.mk:3: Expected a BUILDLINK_TREE line.\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_NoBuildlinkTreeAtEnd(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_no_BUILDLINK_TREE_at_end(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -176,7 +176,7 @@
                "WARN: buildlink3.mk:15: This line should contain the following text: BUILDLINK_TREE+=\t-hs-X11\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_MultipleInclusionWrong(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_multiple_inclusion_wrong(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -193,7 +193,7 @@
                "WARN: buildlink3.mk:6: This line should contain the following text: HS_X11_BUILDLINK3_MK:=\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_EndIfMissing(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_missing_endif(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -208,7 +208,7 @@
        c.Check(s.Output(), equals, "WARN: buildlink3.mk:EOF: Expected .endif\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_UnknownDependencyPatterns(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_unknown_dependency_patterns(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -233,7 +233,7 @@
                "WARN: buildlink3.mk:10: Unknown dependency pattern \"hs-X11!=1.6.1.2nb2\".\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_PkgbaseWithVariable(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_PKGBASE_with_variable(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
@@ -255,7 +255,7 @@
        c.Check(s.Output(), equals, "WARN: buildlink3.mk:3: Please use \"py\" instead of \"${PYPKGPREFIX}\".\n")
 }
 
-func (s *Suite) TestChecklinesBuildlink3_PkgbaseWithUnknownVariable(c *check.C) {
+func (s *Suite) Test_ChecklinesBuildlink3Mk_PKGBASE_with_unknown_variable(c *check.C) {
        G.globalData.InitVartypes()
        mklines := s.NewMkLines("buildlink3.mk",
                "# $"+"NetBSD$",
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/category_test.go
--- a/pkgtools/pkglint/files/category_test.go   Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/category_test.go   Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestCheckdirCategory_TotallyBroken(c *check.C) {
+func (s *Suite) Test_CheckdirCategory_totally_broken(c *check.C) {
        G.globalData.InitVartypes()
        s.CreateTmpFile(c, "archivers/Makefile", ""+
                "# $\n"+
@@ -33,7 +33,7 @@
                "ERROR: ~/archivers/Makefile:4: The file should end here.\n")
 }
 
-func (s *Suite) TestCheckdirCategory_InvalidComment(c *check.C) {
+func (s *Suite) Test_CheckdirCategory_invalid_comment(c *check.C) {
        G.globalData.InitVartypes()
        s.CreateTmpFile(c, "archivers/Makefile", ""+
                "# $"+"NetBSD$\n"+
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/dir_test.go
--- a/pkgtools/pkglint/files/dir_test.go        Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/dir_test.go        Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestCheckDirent_outside(c *check.C) {
+func (s *Suite) Test_CheckDirent_outside(c *check.C) {
        s.CreateTmpFile(c, "empty", "")
 
        CheckDirent(s.tmpdir)
@@ -12,7 +12,7 @@
        c.Check(s.Output(), equals, "ERROR: ~: Cannot determine the pkgsrc root directory for \"~\".\n")
 }
 
-func (s *Suite) TestCheckDirent(c *check.C) {
+func (s *Suite) Test_CheckDirent(c *check.C) {
        s.CreateTmpFile(c, "mk/bsd.pkg.mk", "")
        s.CreateTmpFile(c, "category/package/Makefile", "")
        s.CreateTmpFile(c, "category/Makefile", "")
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/distinfo_test.go
--- a/pkgtools/pkglint/files/distinfo_test.go   Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/distinfo_test.go   Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestChecklinesDistinfo(c *check.C) {
+func (s *Suite) Test_ChecklinesDistinfo(c *check.C) {
        s.CreateTmpFile(c, "patches/patch-aa", ""+
                "$"+"NetBSD$ line is ignored\n"+
                "patch contents\n")
@@ -28,7 +28,7 @@
                "WARN: distinfo:7: Patch file \"patch-nonexistent\" does not exist in directory \"patches\".\n")
 }
 
-func (s *Suite) TestChecklinesDistinfo_GlobalHashMismatch(c *check.C) {
+func (s *Suite) Test_ChecklinesDistinfo_global_hash_mismatch(c *check.C) {
        otherLine := NewLine("other/distinfo", 7, "dummy", nil)
        G.Hash = make(map[string]*Hash)
        G.Hash["SHA512:pkgname-1.0.tar.gz"] = &Hash{"asdfasdf", otherLine}
@@ -43,7 +43,7 @@
                "ERROR: distinfo:EOF: Expected SHA1, RMD160, SHA512, Size checksums for \"pkgname-1.0.tar.gz\", got SHA512.\n")
 }
 
-func (s *Suite) TestChecklinesDistinfo_UncommittedPatch(c *check.C) {
+func (s *Suite) Test_ChecklinesDistinfo_uncommitted_patch(c *check.C) {
        s.CreateTmpFile(c, "patches/patch-aa", ""+
                "$"+"NetBSD$\n"+
                "\n"+
@@ -65,7 +65,7 @@
                "WARN: ~/distinfo:3: patches/patch-aa is registered in distinfo but not added to CVS.\n")
 }
 
-func (s *Suite) TestChecklinesDistinfo_UnrecordedPatches(c *check.C) {
+func (s *Suite) Test_ChecklinesDistinfo_unrecorded_patches(c *check.C) {
        s.CreateTmpFile(c, "patches/CVS/Entries", "")
        s.CreateTmpFile(c, "patches/patch-aa", "")
        s.CreateTmpFile(c, "patches/patch-src-Makefile", "")
@@ -84,7 +84,7 @@
                "ERROR: ~/distinfo: patch \"patches/patch-src-Makefile\" is not recorded. Run \""+confMake+" makepatchsum\".\n")
 }
 
-func (s *Suite) TestChecklinesDistinfo_ManualPatches(c *check.C) {
+func (s *Suite) Test_ChecklinesDistinfo_manual_patches(c *check.C) {
        s.CreateTmpFile(c, "patches/manual-libtool.m4",
                "")
        G.CurrentDir = s.tmpdir
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/expecter.go
--- a/pkgtools/pkglint/files/expecter.go        Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/expecter.go        Sat Jul 09 09:43:48 2016 +0000
@@ -37,9 +37,9 @@
        exp.index--
 }
 
-func (exp *Expecter) AdvanceIfMatches(re string) bool {
+func (exp *Expecter) AdvanceIfMatches(re RegexPattern) bool {
        if G.opts.Debug {
-               defer tracecall2(exp.CurrentLine().Text, re)()
+               defer tracecall(exp.CurrentLine().Text, re)()
        }
 
        if !exp.EOF() {
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/files_test.go
--- a/pkgtools/pkglint/files/files_test.go      Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/files_test.go      Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestConvertToLogicalLines_nocont(c *check.C) {
+func (s *Suite) Test_convertToLogicalLines_no_continuation(c *check.C) {
        rawText := "" +
                "first line\n" +
                "second line\n"
@@ -16,7 +16,7 @@
        c.Check(lines[1].String(), equals, "fname_nocont:2: second line")
 }
 
-func (s *Suite) TestConvertToLogicalLines_cont(c *check.C) {
+func (s *Suite) Test_convertToLogicalLines_continuation(c *check.C) {
        rawText := "" +
                "first line \\\n" +
                "second line\n" +
@@ -29,7 +29,7 @@
        c.Check(lines[1].String(), equals, "fname_cont:3: third")
 }
 
-func (s *Suite) TestConvertToLogicalLines_contInLastLine(c *check.C) {
+func (s *Suite) Test_convertToLogicalLines_continuationInLastLine(c *check.C) {
        rawText := "" +
                "last line\\"
 
@@ -40,7 +40,7 @@
        c.Check(s.Stdout(), equals, "ERROR: fname_contlast:EOF: File must end with a newline.\n")
 }
 
-func (s *Suite) TestSplitRawLine(c *check.C) {
+func (s *Suite) Test_splitRawLine(c *check.C) {
        leadingWhitespace, text, trailingWhitespace, continuation := splitRawLine("\n")
 
        c.Check(leadingWhitespace, equals, "")
@@ -56,7 +56,7 @@
        c.Check(continuation, equals, "\\")
 }
 
-func (s *Suite) TestAutofix_show(c *check.C) {
+func (s *Suite) Test_show_autofix(c *check.C) {
        s.UseCommandLine(c, "--show-autofix")
        fname := s.CreateTmpFile(c, "Makefile", ""+
                "line1\n"+
@@ -76,7 +76,7 @@
                "AUTOFIX: ~/Makefile:2: Replacing regular expression \".\" with \"X\".\n")
 }
 
-func (s *Suite) TestAutofix_fix(c *check.C) {
+func (s *Suite) Test_autofix(c *check.C) {
        s.UseCommandLine(c, "--autofix")
        fname := s.CreateTmpFile(c, "Makefile", ""+
                "line1\n"+
diff -r b3ad21526b38 -r 8b737e01c575 pkgtools/pkglint/files/getopt_test.go
--- a/pkgtools/pkglint/files/getopt_test.go     Sat Jul 09 09:31:05 2016 +0000
+++ b/pkgtools/pkglint/files/getopt_test.go     Sat Jul 09 09:43:48 2016 +0000
@@ -4,7 +4,7 @@
        check "gopkg.in/check.v1"
 )
 
-func (s *Suite) TestGetopt_Short(c *check.C) {
+func (s *Suite) Test_Options_Parse_short(c *check.C) {
        opts := NewOptions()
        var help bool
        opts.AddFlagVar('h', "help", &help, false, "prints a help page")
@@ -16,7 +16,7 @@
        c.Check(help, equals, true)
 }



Home | Main Index | Thread Index | Old Index