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:           Mon Mar 21 22:30:06 UTC 2022

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: mkassignchecker.go
            mkassignchecker_test.go

Log Message:
pkgtools/pkglint: update to 22.1.0

Changes since 21.4.4:

Python packages that declare 2.7 as an incompatible Python version no
longer need to provide a rationale for this since it is common knowledge
that Python 2.7 is old and therefore unsupported by many modern
packages.


To generate a diff of this commit:
cvs rdiff -u -r1.713 -r1.714 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.12 -r1.13 pkgsrc/pkgtools/pkglint/files/mkassignchecker.go
cvs rdiff -u -r1.9 -r1.10 \
    pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.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.713 pkgsrc/pkgtools/pkglint/Makefile:1.714
--- pkgsrc/pkgtools/pkglint/Makefile:1.713      Sat Mar 12 12:03:40 2022
+++ pkgsrc/pkgtools/pkglint/Makefile    Mon Mar 21 22:30:06 2022
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.713 2022/03/12 12:03:40 rillig Exp $
+# $NetBSD: Makefile,v 1.714 2022/03/21 22:30:06 rillig Exp $
 
-PKGNAME=       pkglint-21.4.4
+PKGNAME=       pkglint-22.1.0
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/mkassignchecker.go
diff -u pkgsrc/pkgtools/pkglint/files/mkassignchecker.go:1.12 pkgsrc/pkgtools/pkglint/files/mkassignchecker.go:1.13
--- pkgsrc/pkgtools/pkglint/files/mkassignchecker.go:1.12       Sat Jan  1 12:44:24 2022
+++ pkgsrc/pkgtools/pkglint/files/mkassignchecker.go    Mon Mar 21 22:30:06 2022
@@ -345,7 +345,8 @@ func (ck *MkAssignChecker) checkLeftRati
        }
 
        mkline := ck.MkLine
-       vartype := G.Pkgsrc.VariableType(ck.MkLines, mkline.Varname())
+       varname := mkline.Varname()
+       vartype := G.Pkgsrc.VariableType(ck.MkLines, varname)
        if vartype == nil || !vartype.NeedsRationale() {
                return
        }
@@ -354,7 +355,13 @@ func (ck *MkAssignChecker) checkLeftRati
                return
        }
 
-       mkline.Warnf("Setting variable %s should have a rationale.", mkline.Varname())
+       if varname == "PYTHON_VERSIONS_INCOMPATIBLE" && mkline.Value() == "27" {
+               // No warning since it is rather common that a modern Python
+               // package supports all Python versions starting with 3.0.
+               return
+       }
+
+       mkline.Warnf("Setting variable %s should have a rationale.", varname)
        mkline.Explain(
                "Since this variable prevents the package from being built in some situations,",
                "the reasons for this restriction should be documented.",

Index: pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.9 pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.10
--- pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.9   Sun Jan 16 19:14:52 2022
+++ pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go       Mon Mar 21 22:30:06 2022
@@ -645,7 +645,19 @@ func (s *Suite) Test_MkAssignChecker_che
                "WARN: filename.mk:1: Setting variable NOT_FOR_PLATFORM should have a rationale.",
                "WARN: filename.mk:2: Setting variable NOT_FOR_PLATFORM should have a rationale.")
 
-       // The whole rationale check is only enabled when -Wextra is given.
+       // Many Python modules support Python 3 only.
+       // These don't need a rationale since this case is common knowledge.
+       testLines(
+               lines(
+                       MkCvsID,
+                       "",
+                       "PYTHON_VERSIONS_INCOMPATIBLE=\t27",
+                       "",
+                       "PYTHON_VERSIONS_INCOMPATIBLE=\t38"),
+               "WARN: filename.mk:5: Setting variable "+
+                       "PYTHON_VERSIONS_INCOMPATIBLE should have a rationale.")
+
+       // The rationale check is only enabled when -Wextra is given.
        t.SetUpCommandLine()
 
        test(



Home | Main Index | Thread Index | Old Index