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 23 19:55:08 UTC 2020

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: pkglint.go pkglint_test.go

Log Message:
pkgtools/pkglint: update to 20.1.0

Changes since 19.4.13:

It is an error to have TODO lines in DESCR files. These are typically
generated by url2pkg and should be replaced with proper text before
committing the package.


To generate a diff of this commit:
cvs rdiff -u -r1.637 -r1.638 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.77 -r1.78 pkgsrc/pkgtools/pkglint/files/pkglint.go
cvs rdiff -u -r1.62 -r1.63 pkgsrc/pkgtools/pkglint/files/pkglint_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.637 pkgsrc/pkgtools/pkglint/Makefile:1.638
--- pkgsrc/pkgtools/pkglint/Makefile:1.637      Sun Mar 22 17:43:15 2020
+++ pkgsrc/pkgtools/pkglint/Makefile    Mon Mar 23 19:55:08 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.637 2020/03/22 17:43:15 rillig Exp $
+# $NetBSD: Makefile,v 1.638 2020/03/23 19:55:08 rillig Exp $
 
-PKGNAME=       pkglint-19.4.13
+PKGNAME=       pkglint-20.1.0
 CATEGORIES=    pkgtools
 DISTNAME=      tools
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=golang/}

Index: pkgsrc/pkgtools/pkglint/files/pkglint.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint.go:1.77 pkgsrc/pkgtools/pkglint/files/pkglint.go:1.78
--- pkgsrc/pkgtools/pkglint/files/pkglint.go:1.77       Wed Mar 18 08:24:49 2020
+++ pkgsrc/pkgtools/pkglint/files/pkglint.go    Mon Mar 23 19:55:08 2020
@@ -441,12 +441,19 @@ func CheckLinesDescr(lines *Lines) {
                }
        }
 
+       checkTodo := func(line *Line) {
+               if hasPrefix(line.Text, "TODO:") {
+                       line.Errorf("DESCR files must not have TODO lines.")
+               }
+       }
+
        for _, line := range lines.Lines {
                ck := LineChecker{line}
                ck.CheckLength(80)
                ck.CheckTrailingWhitespace()
                ck.CheckValidCharacters()
                checkVarRefs(line)
+               checkTodo(line)
        }
 
        CheckLinesTrailingEmptyLines(lines)

Index: pkgsrc/pkgtools/pkglint/files/pkglint_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.62 pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.63
--- pkgsrc/pkgtools/pkglint/files/pkglint_test.go:1.62  Sun Mar 22 17:43:15 2020
+++ pkgsrc/pkgtools/pkglint/files/pkglint_test.go       Mon Mar 23 19:55:08 2020
@@ -837,6 +837,29 @@ func (s *Suite) Test_CheckLinesDescr__va
        test("$@", nil...)
 }
 
+func (s *Suite) Test_CheckLinesDescr__TODO(c *check.C) {
+       t := s.Init(c)
+
+       t.SetUpVartypes()
+
+       test := func(text string, diagnostics ...string) {
+               lines := t.NewLines("DESCR",
+                       text)
+
+               CheckLinesDescr(lines)
+
+               t.CheckOutput(diagnostics)
+       }
+
+       // See pkgtools/url2pkg/files/url2pkg.py
+       test("TODO: Fill in a short description of the package",
+
+               "ERROR: DESCR:1: DESCR files must not have TODO lines.")
+
+       test("TODO-list is an organizer for everything you need to do, now or later",
+               nil...)
+}
+
 func (s *Suite) Test_CheckLinesMessage__one_line_of_text(c *check.C) {
        t := s.Init(c)
 



Home | Main Index | Thread Index | Old Index