pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkglint



Module Name:    pkgsrc
Committed By:   rillig
Date:           Thu Feb 21 23:44:55 UTC 2019

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: mkline.go mkline_test.go
            mklinechecker.go mklinechecker_test.go mklines.go mklines_test.go
            mkparser_test.go mkshwalker.go mkshwalker_test.go package.go
            pkglint.1 pkgsrc_test.go shell.go shell_test.go util.go vartype.go
            vartypecheck.go

Log Message:
pkgtools/pkglint: update to 5.7.1

Changes since 5.7.0:

* Removed a line of code that was meant only for development, not for
  production use, from util.go.


To generate a diff of this commit:
cvs rdiff -u -r1.567 -r1.568 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.46 -r1.47 pkgsrc/pkgtools/pkglint/files/mkline.go
cvs rdiff -u -r1.51 -r1.52 pkgsrc/pkgtools/pkglint/files/mkline_test.go
cvs rdiff -u -r1.29 -r1.30 pkgsrc/pkgtools/pkglint/files/mklinechecker.go
cvs rdiff -u -r1.25 -r1.26 \
    pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go
cvs rdiff -u -r1.41 -r1.42 pkgsrc/pkgtools/pkglint/files/mklines.go
cvs rdiff -u -r1.36 -r1.37 pkgsrc/pkgtools/pkglint/files/mklines_test.go
cvs rdiff -u -r1.22 -r1.23 pkgsrc/pkgtools/pkglint/files/mkparser_test.go
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/pkglint/files/mkshwalker.go \
    pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go
cvs rdiff -u -r1.45 -r1.46 pkgsrc/pkgtools/pkglint/files/package.go
cvs rdiff -u -r1.53 -r1.54 pkgsrc/pkgtools/pkglint/files/pkglint.1
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
cvs rdiff -u -r1.33 -r1.34 pkgsrc/pkgtools/pkglint/files/shell.go
cvs rdiff -u -r1.39 -r1.40 pkgsrc/pkgtools/pkglint/files/shell_test.go
cvs rdiff -u -r1.37 -r1.38 pkgsrc/pkgtools/pkglint/files/util.go
cvs rdiff -u -r1.26 -r1.27 pkgsrc/pkgtools/pkglint/files/vartype.go
cvs rdiff -u -r1.49 -r1.50 pkgsrc/pkgtools/pkglint/files/vartypecheck.go

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkglint/Makefile
diff -u pkgsrc/pkgtools/pkglint/Makefile:1.567 pkgsrc/pkgtools/pkglint/Makefile:1.568
--- pkgsrc/pkgtools/pkglint/Makefile:1.567      Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/Makefile    Thu Feb 21 23:44:55 2019
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.567 2019/02/21 22:49:03 rillig Exp $
+# $NetBSD: Makefile,v 1.568 2019/02/21 23:44:55 rillig Exp $
 
-PKGNAME=       pkglint-5.7.0
+PKGNAME=       pkglint-5.7.1
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/mkline.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline.go:1.46 pkgsrc/pkgtools/pkglint/files/mkline.go:1.47
--- pkgsrc/pkgtools/pkglint/files/mkline.go:1.46        Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mkline.go     Thu Feb 21 23:44:55 2019
@@ -761,7 +761,7 @@ func (mkline *MkLineImpl) VariableNeedsQ
 
 func (mkline *MkLineImpl) DetermineUsedVariables() []string {
        // TODO: It would be good to have these variables as MkVarUse objects
-       // including the context in which they are used.
+       //  including the context in which they are used.
 
        var varnames []string
 

Index: pkgsrc/pkgtools/pkglint/files/mkline_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.51 pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.52
--- pkgsrc/pkgtools/pkglint/files/mkline_test.go:1.51   Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mkline_test.go        Thu Feb 21 23:44:55 2019
@@ -709,7 +709,7 @@ func (s *Suite) Test_MkLine_VariableNeed
 }
 
 // TODO: COMPILER_RPATH_FLAG and LINKER_RPATH_FLAG have different types
-// defined in vardefs.go; examine why.
+//  defined in vardefs.go; examine why.
 func (s *Suite) Test_MkLine_VariableNeedsQuoting__shellword_part(c *check.C) {
        t := s.Init(c)
 

Index: pkgsrc/pkgtools/pkglint/files/mklinechecker.go
diff -u pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.29 pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.30
--- pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.29 Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mklinechecker.go      Thu Feb 21 23:44:55 2019
@@ -422,7 +422,7 @@ func (ck MkLineChecker) CheckVaruse(varu
 
        if G.Opts.WarnQuoting && vuc.quoting != VucQuotUnknown && needsQuoting != unknown {
                // FIXME: Why "Shellword" when there's no indication that this is actually a shell type?
-               // It's for splitting the value into tokens, taking "double" and 'single' quotes into account.
+               //  It's for splitting the value into tokens, taking "double" and 'single' quotes into account.
                ck.CheckVaruseShellword(varname, vartype, vuc, varuse.Mod(), needsQuoting)
        }
 
@@ -587,11 +587,11 @@ func (ck MkLineChecker) checkVarusePermi
 // may not be used at load time.
 func (ck MkLineChecker) warnVaruseToolLoadTime(varname string, tool *Tool) {
        // TODO: While using a tool by its variable name may be ok at load time,
-       // doing the same with the plain name of a tool is never ok.
-       // "VAR!= cat" is never guaranteed to call the correct cat.
-       // Even for shell builtins like echo and printf, bmake may decide
-       // to skip the shell and execute the commands via execve, which
-       // means that even echo is not a shell-builtin anymore.
+       //  doing the same with the plain name of a tool is never ok.
+       //  "VAR!= cat" is never guaranteed to call the correct cat.
+       //  Even for shell builtins like echo and printf, bmake may decide
+       //  to skip the shell and execute the commands via execve, which
+       //  means that even echo is not a shell-builtin anymore.
 
        // TODO: Replace "parse time" with "load time" everywhere.
 

Index: pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.25 pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.26
--- pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.25    Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go Thu Feb 21 23:44:55 2019
@@ -778,9 +778,9 @@ func (s *Suite) Test_MkLineChecker_Check
        // name of another variable, and that variable is not known. Only XKBBASE is known.
        //
        // FIXME: The below warnings are wrong because the MkParser does not recognize the
-       // slash as part of a variable name. Because of that, parsing stops before the $.
-       // The warning "Unclosed Make variable" wrongly assumes that any parse error from
-       // a variable use is because of unclosed braces, which it isn't in this case.h
+       //  slash as part of a variable name. Because of that, parsing stops before the $.
+       //  The warning "Unclosed Make variable" wrongly assumes that any parse error from
+       //  a variable use is because of unclosed braces, which it isn't in this case.
        t.CheckOutputLines(
                "WARN: x11/xkeyboard-config/Makefile:2: Unclosed Make variable starting at \"${${XKBBASE}/xkbcomp...\".",
                "WARN: x11/xkeyboard-config/Makefile:2: Unclosed Make variable starting at \"${${XKBBASE}/xkbcomp...\".")
@@ -810,7 +810,7 @@ func (s *Suite) Test_MkLineChecker_check
        ck := MkLineChecker{mkline}
 
        // FIXME: checkDirectiveCondEmpty cannot know whether it is empty(...) or !empty(...).
-       // It must know that to generate the proper diagnostics.
+       //  It must know that to generate the proper diagnostics.
 
        ck.checkDirectiveCondEmpty(NewMkVarUse("PKGPATH", "Mpattern"))
 

Index: pkgsrc/pkgtools/pkglint/files/mklines.go
diff -u pkgsrc/pkgtools/pkglint/files/mklines.go:1.41 pkgsrc/pkgtools/pkglint/files/mklines.go:1.42
--- pkgsrc/pkgtools/pkglint/files/mklines.go:1.41       Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mklines.go    Thu Feb 21 23:44:55 2019
@@ -50,7 +50,7 @@ func NewMkLines(lines Lines) MkLines {
 }
 
 // TODO: Consider defining an interface MkLinesChecker (different name, though, since this one confuses even me)
-// that checks a single topic, like:
+//  that checks a single topic, like:
 //
 //  * PlistVars
 //  * ForLoops

Index: pkgsrc/pkgtools/pkglint/files/mklines_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mklines_test.go:1.36 pkgsrc/pkgtools/pkglint/files/mklines_test.go:1.37
--- pkgsrc/pkgtools/pkglint/files/mklines_test.go:1.36  Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mklines_test.go       Thu Feb 21 23:44:55 2019
@@ -337,7 +337,7 @@ func (s *Suite) Test_MkLines_collectDefi
        // The OSV.NetBSD variable is used implicitly via the OSV variable, therefore no warning.
        t.CheckOutputLines(
                // FIXME: the below warning is wrong; it's ok to have SUBST blocks in all files,
-               // maybe except buildlink3.mk.
+               //  maybe except buildlink3.mk.
                "WARN: determine-defined-variables.mk:12: The variable SUBST_VARS.subst may not be set " +
                        "(only given a default value, or appended to) in this file; " +
                        "it would be ok in Makefile, Makefile.common or options.mk.")

Index: pkgsrc/pkgtools/pkglint/files/mkparser_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.22 pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.23
--- pkgsrc/pkgtools/pkglint/files/mkparser_test.go:1.22 Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/mkparser_test.go      Thu Feb 21 23:44:55 2019
@@ -796,7 +796,7 @@ func (s *Suite) Test_MkCondWalker_Walk(c
        }
 
        // TODO: Add callbacks for And, Or, Not if needed.
-       // Especially Not(Empty(VARNAME)) should be an interesting case.
+       //  Especially Not(Empty(VARNAME)) should be an interesting case.
 
        mkline.Cond().Walk(&MkCondCallback{
                Defined: func(varname string) {

Index: pkgsrc/pkgtools/pkglint/files/mkshwalker.go
diff -u pkgsrc/pkgtools/pkglint/files/mkshwalker.go:1.6 pkgsrc/pkgtools/pkglint/files/mkshwalker.go:1.7
--- pkgsrc/pkgtools/pkglint/files/mkshwalker.go:1.6     Mon Dec 17 00:15:39 2018
+++ pkgsrc/pkgtools/pkglint/files/mkshwalker.go Thu Feb 21 23:44:55 2019
@@ -52,7 +52,7 @@ type MkShWalkerPathElement struct {
        // arguments individually, arg1 will have index 0 and arg2 will have index 1.
        //
        // TODO: It might be worth defining negative indexes to correspond
-       // to the fields "Cond", "Action", "Else", etc.
+       //  to the fields "Cond", "Action", "Else", etc.
        Index int
 
        Element interface{}
Index: pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go:1.6 pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go:1.7
--- pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go:1.6        Mon Dec 17 00:15:39 2018
+++ pkgsrc/pkgtools/pkglint/files/mkshwalker_test.go    Thu Feb 21 23:44:55 2019
@@ -49,7 +49,7 @@ func (s *Suite) Test_MkShWalker_Walk(c *
                walker.Walk(list)
 
                // TODO: Provide a reduced AST that omits all "AndOr with 1 pipelines", etc.
-               // It should look like this:
+               //  It should look like this:
                //
                //  List with 5 andOrs (or generic Commands?)
                //    If with 1 then-branch(es)

Index: pkgsrc/pkgtools/pkglint/files/package.go
diff -u pkgsrc/pkgtools/pkglint/files/package.go:1.45 pkgsrc/pkgtools/pkglint/files/package.go:1.46
--- pkgsrc/pkgtools/pkglint/files/package.go:1.45       Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/package.go    Thu Feb 21 23:44:55 2019
@@ -166,9 +166,9 @@ func (pkg *Package) loadPackageMakefile(
        }
 
        // TODO: Is this still necessary? This code is 20 years old and was introduced
-       // when pkglint loaded the package Makefile including all included files into
-       // a single string. Maybe it makes sense to print the file inclusion hierarchy
-       // to quickly see files that cannot be included because of unresolved variables.
+       //  when pkglint loaded the package Makefile including all included files into
+       //  a single string. Maybe it makes sense to print the file inclusion hierarchy
+       //  to quickly see files that cannot be included because of unresolved variables.
        if G.Opts.DumpMakefile {
                G.out.WriteLine("Whole Makefile (with all included files) follows:")
                for _, line := range allLines.lines.Lines {
@@ -885,9 +885,9 @@ func (pkg *Package) checkIncludeConditio
                }
 
                // TODO: Check whether the conditional variables are the same on both places.
-               // Ideally they should match, but there may be some differences in internal
-               // variables, which need to be filtered out before comparing them, like it is
-               // already done with *_MK variables.
+               //  Ideally they should match, but there may be some differences in internal
+               //  variables, which need to be filtered out before comparing them, like it is
+               //  already done with *_MK variables.
        }
 }
 

Index: pkgsrc/pkgtools/pkglint/files/pkglint.1
diff -u pkgsrc/pkgtools/pkglint/files/pkglint.1:1.53 pkgsrc/pkgtools/pkglint/files/pkglint.1:1.54
--- pkgsrc/pkgtools/pkglint/files/pkglint.1:1.53        Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/pkglint.1     Thu Feb 21 23:44:55 2019
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkglint.1,v 1.53 2019/02/21 22:49:03 rillig Exp $
+.\"    $NetBSD: pkglint.1,v 1.54 2019/02/21 23:44:55 rillig Exp $
 .\"    From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
 .\"
 .\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun%itojun.org@localhost>.

Index: pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.16 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.17
--- pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.16   Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go        Thu Feb 21 23:44:55 2019
@@ -161,7 +161,7 @@ func (s *Suite) Test_Pkgsrc_loadTools__B
        c.Check(G.Pkgsrc.IsBuildDef("VARBASE"), equals, false)
 
        // FIXME: There should be a warning for VARBASE, but G.Pkgsrc.UserDefinedVars
-       // does not contain anything at mklinechecker.go:/UserDefinedVars/.
+       //  does not contain anything at mklinechecker.go:/UserDefinedVars/.
 }
 
 func (s *Suite) Test_Pkgsrc_loadDocChanges__not_found(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/shell.go
diff -u pkgsrc/pkgtools/pkglint/files/shell.go:1.33 pkgsrc/pkgtools/pkglint/files/shell.go:1.34
--- pkgsrc/pkgtools/pkglint/files/shell.go:1.33 Sat Jan 26 16:31:33 2019
+++ pkgsrc/pkgtools/pkglint/files/shell.go      Thu Feb 21 23:44:55 2019
@@ -351,7 +351,7 @@ func (shline *ShellLine) CheckShellComma
        }
        walker.Callback.Word = func(word *ShToken) {
                // TODO: Try to replace false with true here; it had been set to false
-               // TODO: in 2016 for no apparent reason.
+               //  in 2016 for no apparent reason.
                spc.shline.CheckWord(word.MkText, false, time)
        }
 

Index: pkgsrc/pkgtools/pkglint/files/shell_test.go
diff -u pkgsrc/pkgtools/pkglint/files/shell_test.go:1.39 pkgsrc/pkgtools/pkglint/files/shell_test.go:1.40
--- pkgsrc/pkgtools/pkglint/files/shell_test.go:1.39    Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/shell_test.go Thu Feb 21 23:44:55 2019
@@ -568,7 +568,7 @@ func (s *Suite) Test_ShellLine_CheckWord
        shline.CheckWord(shline.mkline.ShellCommand(), false, RunTime)
 
        // FIXME: Should be parsed correctly. Make passes the dollar through (probably),
-       // and the shell parser should complain about the unfinished string literal.
+       //  and the shell parser should complain about the unfinished string literal.
        t.CheckOutputLines(
                "WARN: filename:1: Internal pkglint error in ShTokenizer.ShAtom at \"$\" (quoting=s).",
                "WARN: filename:1: Internal pkglint error in ShellLine.CheckWord at \"'$\" (quoting=s), rest: $")
@@ -916,7 +916,6 @@ func (s *Suite) Test_ShellLine_checkWord
 
        test(108, "$$$$")
 
-       // TODO: The $ variable in line 108 doesn't need quoting.
        t.CheckOutputLines(
                "WARN: module.mk:102: Unquoted shell variable \"from\".",
                "WARN: module.mk:102: Unquoted shell variable \"to\".",

Index: pkgsrc/pkgtools/pkglint/files/util.go
diff -u pkgsrc/pkgtools/pkglint/files/util.go:1.37 pkgsrc/pkgtools/pkglint/files/util.go:1.38
--- pkgsrc/pkgtools/pkglint/files/util.go:1.37  Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/util.go       Thu Feb 21 23:44:55 2019
@@ -580,7 +580,7 @@ func (s *Scope) FirstDefinition(varname 
        if mkline != nil && mkline.IsVarassign() {
                lastLine := s.LastDefinition(varname)
                if lastLine != mkline {
-                       mkline.Notef("FirstDefinition differs from LastDefinition in %s.", mkline.RefTo(lastLine))
+                       //mkline.Notef("FirstDefinition differs from LastDefinition in %s.", mkline.RefTo(lastLine))
                }
                return mkline
        }

Index: pkgsrc/pkgtools/pkglint/files/vartype.go
diff -u pkgsrc/pkgtools/pkglint/files/vartype.go:1.26 pkgsrc/pkgtools/pkglint/files/vartype.go:1.27
--- pkgsrc/pkgtools/pkglint/files/vartype.go:1.26       Sat Jan 26 16:31:33 2019
+++ pkgsrc/pkgtools/pkglint/files/vartype.go    Thu Feb 21 23:44:55 2019
@@ -105,8 +105,8 @@ func (vt *Vartype) AllowedFiles(perms AC
 // IsConsideredList returns whether the type is considered a list.
 //
 // FIXME: Explain why this method is necessary. IsList is clear, and MayBeAppendedTo also,
-// but this in-between state needs a decent explanation.
-// Probably MkLineChecker.checkVartype needs to be revisited completely.
+//  but this in-between state needs a decent explanation.
+//  Probably MkLineChecker.checkVartype needs to be revisited completely.
 func (vt *Vartype) IsConsideredList() bool {
        if vt.kindOfList == lkShell {
                return true

Index: pkgsrc/pkgtools/pkglint/files/vartypecheck.go
diff -u pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.49 pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.50
--- pkgsrc/pkgtools/pkglint/files/vartypecheck.go:1.49  Thu Feb 21 22:49:03 2019
+++ pkgsrc/pkgtools/pkglint/files/vartypecheck.go       Thu Feb 21 23:44:55 2019
@@ -610,8 +610,8 @@ func (cv *VartypeCheck) Identifier() {
        }
 
        if cv.Value != cv.ValueNoVar {
-               // TODO: Activate this warning again, or document why it is not useful.
-               //line.logWarning("Identifiers should be given directly.")
+               // TODO: Activate this warning again, or document why that is not useful.
+               //  line.logWarning("Identifiers should be given directly.")
        }
 
        switch {



Home | Main Index | Thread Index | Old Index