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: Fri Jun 24 07:16:23 UTC 2022
Modified Files:
pkgsrc/pkgtools/pkglint: Makefile
pkgsrc/pkgtools/pkglint/files: alternatives.go alternatives_test.go
autofix.go check_test.go mkassignchecker_test.go
mkcondchecker_test.go mkline.go mkshparser.go
mkvarusechecker_test.go vartypecheck_test.go
Log Message:
pkgtools/pkglint: update to 22.2.0
Changes since 22.1.0:
In ALTERNATIVES files, the wrapper path must be either in bin,
@PKGMANDIR@ or sbin. This catches typos like "in" instead of "bin", as
well as hard-coded "man".
To generate a diff of this commit:
cvs rdiff -u -r1.717 -r1.718 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/pkgtools/pkglint/files/alternatives.go \
pkgsrc/pkgtools/pkglint/files/mkshparser.go
cvs rdiff -u -r1.19 -r1.20 pkgsrc/pkgtools/pkglint/files/alternatives_test.go
cvs rdiff -u -r1.41 -r1.42 pkgsrc/pkgtools/pkglint/files/autofix.go
cvs rdiff -u -r1.79 -r1.80 pkgsrc/pkgtools/pkglint/files/check_test.go
cvs rdiff -u -r1.10 -r1.11 \
pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go
cvs rdiff -u -r1.9 -r1.10 pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go
cvs rdiff -u -r1.84 -r1.85 pkgsrc/pkgtools/pkglint/files/mkline.go
cvs rdiff -u -r1.15 -r1.16 \
pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go
cvs rdiff -u -r1.91 -r1.92 pkgsrc/pkgtools/pkglint/files/vartypecheck_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.717 pkgsrc/pkgtools/pkglint/Makefile:1.718
--- pkgsrc/pkgtools/pkglint/Makefile:1.717 Thu Jun 2 18:52:05 2022
+++ pkgsrc/pkgtools/pkglint/Makefile Fri Jun 24 07:16:23 2022
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.717 2022/06/02 18:52:05 bsiegert Exp $
+# $NetBSD: Makefile,v 1.718 2022/06/24 07:16:23 rillig Exp $
-PKGNAME= pkglint-22.1.0
-PKGREVISION= 3
+PKGNAME= pkglint-22.2.0
CATEGORIES= pkgtools
DISTNAME= tools
MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/}
Index: pkgsrc/pkgtools/pkglint/files/alternatives.go
diff -u pkgsrc/pkgtools/pkglint/files/alternatives.go:1.20 pkgsrc/pkgtools/pkglint/files/alternatives.go:1.21
--- pkgsrc/pkgtools/pkglint/files/alternatives.go:1.20 Sat Jan 4 19:53:14 2020
+++ pkgsrc/pkgtools/pkglint/files/alternatives.go Fri Jun 24 07:16:23 2022
@@ -29,7 +29,7 @@ func (ck *AlternativesChecker) Check(lin
}
// checkLine checks a single line for the following format:
-// wrapper alternative [optional arguments]
+// wrapper alternative [arguments]
func (ck *AlternativesChecker) checkLine(line *Line, plistFiles map[RelPath]*PlistLine, pkg *Package) {
m, wrapper, space, alternative := match3(line.Text, `^([^\t ]+)([ \t]+)([^\t ]+).*$`)
if !m {
@@ -39,9 +39,21 @@ func (ck *AlternativesChecker) checkLine
return
}
- if ck.checkWrapperAbs(line, NewPath(wrapper)) && plistFiles != nil {
- ck.checkWrapperPlist(line, NewRelPathString(wrapper), plistFiles)
+ if wrapper := NewPath(wrapper); wrapper.IsAbs() {
+ line.Errorf("Alternative wrapper %q must be relative to PREFIX.", wrapper.String())
+ } else {
+ wrapper := NewRelPath(wrapper)
+ if plistFiles[wrapper] != nil {
+ line.Errorf("Alternative wrapper %q must not appear in the PLIST.", wrapper)
+ }
+ if !wrapper.HasPrefixText("bin/") &&
+ !wrapper.HasPrefixText("@PKGMANDIR@/") &&
+ !wrapper.HasPrefixText("sbin/") {
+ line.Errorf("Alternative wrapper %q must be in "+
+ "\"bin\", \"@PKGMANDIR@\" or \"sbin\".", wrapper)
+ }
}
+
if plistFiles != nil {
ck.checkAlternativePlist(line, alternative, plistFiles, pkg)
}
@@ -51,23 +63,6 @@ func (ck *AlternativesChecker) checkLine
LineChecker{line}.CheckTrailingWhitespace()
}
-func (ck *AlternativesChecker) checkWrapperAbs(line *Line, wrapper Path) bool {
- if !wrapper.IsAbs() {
- return true
- }
-
- line.Errorf("Alternative wrapper %q must be relative to PREFIX.", wrapper.String())
- return false
-}
-
-func (ck *AlternativesChecker) checkWrapperPlist(line *Line, wrapper RelPath,
- plistFiles map[RelPath]*PlistLine) {
-
- if plistFiles[wrapper] != nil {
- line.Errorf("Alternative wrapper %q must not appear in the PLIST.", wrapper)
- }
-}
-
func (ck *AlternativesChecker) checkAlternativeAbs(alternative string, line *Line, space string) {
lex := textproc.NewLexer(alternative)
Index: pkgsrc/pkgtools/pkglint/files/mkshparser.go
diff -u pkgsrc/pkgtools/pkglint/files/mkshparser.go:1.20 pkgsrc/pkgtools/pkglint/files/mkshparser.go:1.21
--- pkgsrc/pkgtools/pkglint/files/mkshparser.go:1.20 Wed Jul 1 13:17:41 2020
+++ pkgsrc/pkgtools/pkglint/files/mkshparser.go Fri Jun 24 07:16:23 2022
@@ -82,7 +82,7 @@ func (lex *ShellLexer) Lex(lval *shyySym
trace.Stepf("lex EOF because of a comment")
return
}
- tname := shyyTokname(shyyTok2[ttype-shyyPrivate])
+ tname := shyyTokname(int(shyyTok2[ttype-shyyPrivate]))
switch ttype {
case tkWORD, tkASSIGNMENT_WORD:
trace.Stepf("lex %v %q", tname, lval.Word.MkText)
Index: pkgsrc/pkgtools/pkglint/files/alternatives_test.go
diff -u pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.19 pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.20
--- pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.19 Sat Jan 4 19:53:14 2020
+++ pkgsrc/pkgtools/pkglint/files/alternatives_test.go Fri Jun 24 07:16:23 2022
@@ -71,6 +71,8 @@ func (s *Suite) Test_AlternativesChecker
"ERROR: ALTERNATIVES:5: Invalid line \"invalid\".",
"ERROR: ALTERNATIVES:6: Alternative implementation \"${PREFIX}/bin/firefox\" must appear in the PLIST.",
"ERROR: ALTERNATIVES:6: Alternative implementation \"${PREFIX}/bin/firefox\" must be an absolute path.",
+ "ERROR: ALTERNATIVES:7: Alternative wrapper \"highscores\" "+
+ "must be in \"bin\", \"@PKGMANDIR@\" or \"sbin\".",
"ERROR: ALTERNATIVES:7: Alternative implementation \"@VARBASE@/game/scores\" "+
"must appear in the PLIST as \"${VARBASE}/game/scores\".")
@@ -107,7 +109,7 @@ func (s *Suite) Test_AlternativesChecker
"must be relative to PREFIX.")
}
-func (s *Suite) Test_AlternativesChecker_checkWrapperAbs(c *check.C) {
+func (s *Suite) Test_AlternativesChecker_checkLine__absolute(c *check.C) {
t := s.Init(c)
t.CreateFileLines("ALTERNATIVES",
@@ -117,11 +119,13 @@ func (s *Suite) Test_AlternativesChecker
CheckFileAlternatives(t.File("ALTERNATIVES"), nil)
t.CheckOutputLines(
- "ERROR: ~/ALTERNATIVES:2: Alternative wrapper \"/absolute\" " +
+ "ERROR: ~/ALTERNATIVES:1: Alternative wrapper \"relative\" "+
+ "must be in \"bin\", \"@PKGMANDIR@\" or \"sbin\".",
+ "ERROR: ~/ALTERNATIVES:2: Alternative wrapper \"/absolute\" "+
"must be relative to PREFIX.")
}
-func (s *Suite) Test_AlternativesChecker_checkWrapperPlist(c *check.C) {
+func (s *Suite) Test_AlternativesChecker_checkLine__PLIST(c *check.C) {
t := s.Init(c)
t.SetUpPackage("category/package")
@@ -143,6 +147,26 @@ func (s *Suite) Test_AlternativesChecker
"must not appear in the PLIST.")
}
+func (s *Suite) Test_AlternativesChecker_checkLine__dir(c *check.C) {
+ t := s.Init(c)
+
+ t.CreateFileLines("ALTERNATIVES",
+ "in/typo @PREFIX@/bin/typo",
+ "sbin/daemon @PREFIX@/sbin/daemon-impl",
+ "typo/program @PREFIX@/typo/program-impl",
+ "man/man1/program.1 @PREFIX@/man/man1/program-impl.1")
+
+ CheckFileAlternatives(t.File("ALTERNATIVES"), nil)
+
+ t.CheckOutputLines(
+ "ERROR: ~/ALTERNATIVES:1: Alternative wrapper \"in/typo\" "+
+ "must be in \"bin\", \"@PKGMANDIR@\" or \"sbin\".",
+ "ERROR: ~/ALTERNATIVES:3: Alternative wrapper \"typo/program\" "+
+ "must be in \"bin\", \"@PKGMANDIR@\" or \"sbin\".",
+ "ERROR: ~/ALTERNATIVES:4: Alternative wrapper \"man/man1/program.1\" "+
+ "must be in \"bin\", \"@PKGMANDIR@\" or \"sbin\".")
+}
+
func (s *Suite) Test_AlternativesChecker_checkAlternativeAbs(c *check.C) {
t := s.Init(c)
Index: pkgsrc/pkgtools/pkglint/files/autofix.go
diff -u pkgsrc/pkgtools/pkglint/files/autofix.go:1.41 pkgsrc/pkgtools/pkglint/files/autofix.go:1.42
--- pkgsrc/pkgtools/pkglint/files/autofix.go:1.41 Sun Jun 6 07:41:34 2021
+++ pkgsrc/pkgtools/pkglint/files/autofix.go Fri Jun 24 07:16:23 2022
@@ -279,9 +279,14 @@ func (fix *Autofix) Describef(rawIndex i
// MkLines.Check.
func (fix *Autofix) Apply() {
// XXX: Make the following annotations actually do something.
+ // Their intention is to insert the following conditions around each
+ // function or method call expression in this function, ensuring that this
+ // function is properly covered in all 3 of pkglint's autofix modes.
+ //
// gobco:beforeCall:!G.Opts.ShowAutofix && !G.Opts.Autofix
// gobco:beforeCall:G.Opts.ShowAutofix
// gobco:beforeCall:G.Opts.Autofix
+ //
// See https://github.com/rillig/gobco
line := fix.line
Index: pkgsrc/pkgtools/pkglint/files/check_test.go
diff -u pkgsrc/pkgtools/pkglint/files/check_test.go:1.79 pkgsrc/pkgtools/pkglint/files/check_test.go:1.80
--- pkgsrc/pkgtools/pkglint/files/check_test.go:1.79 Sun Jan 16 19:14:52 2022
+++ pkgsrc/pkgtools/pkglint/files/check_test.go Fri Jun 24 07:16:23 2022
@@ -233,7 +233,7 @@ func (t *Tester) SetUpVartypes() {
func (t *Tester) SetUpMasterSite(varname string, urls ...string) {
if !G.Pkgsrc.vartypes.IsDefinedExact(varname) {
- t.SetUpType(varname, BtFetchURL,
+ t.SetUpVarType(varname, BtFetchURL,
List|SystemProvided,
"buildlink3.mk: none",
"*: use")
@@ -255,13 +255,13 @@ func (t *Tester) SetUpTool(name, varname
return G.Pkgsrc.Tools.def(name, varname, false, validity, nil)
}
-// SetUpType defines a variable to have a certain type and access permissions,
-// like in the type definitions in vardefs.go.
+// SetUpVarType registers the type and access permissions for a variable, like
+// in the variable definitions in vardefs.go.
//
// Example:
-// SetUpType("PKGPATH", BtPkgpath, DefinedIfInScope|NonemptyIfDefined,
+// SetUpVarType("PKGPATH", BtPkgpath, DefinedIfInScope|NonemptyIfDefined,
// "Makefile, *.mk: default, set, append, use, use-loadtime")
-func (t *Tester) SetUpType(varname string, basicType *BasicType,
+func (t *Tester) SetUpVarType(varname string, basicType *BasicType,
options vartypeOptions, aclEntries ...string) {
if len(aclEntries) == 0 {
Index: pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.10 pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.11
--- pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go:1.10 Mon Mar 21 22:30:06 2022
+++ pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go Fri Jun 24 07:16:23 2022
@@ -457,9 +457,9 @@ func (s *Suite) Test_MkAssignChecker_che
t.SetUpVartypes()
t.SetUpTool("awk", "AWK", AtRunTime)
- t.SetUpType("SET_ONLY", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("SET_ONLY", BtUnknown, NoVartypeOptions,
"options.mk: set")
- t.SetUpType("SET_ONLY_DEFAULT_ELSEWHERE", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("SET_ONLY_DEFAULT_ELSEWHERE", BtUnknown, NoVartypeOptions,
"options.mk: set",
"*.mk: default, set")
mklines := t.NewMkLines("options.mk",
Index: pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go:1.9 pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go:1.10
--- pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go:1.9 Sun Jun 14 11:35:54 2020
+++ pkgsrc/pkgtools/pkglint/files/mkcondchecker_test.go Fri Jun 24 07:16:23 2022
@@ -560,17 +560,17 @@ func (s *Suite) Test_MkCondChecker_simpl
// Even when they are in scope, some variables such as PKGREVISION
// or MAKE_JOBS may be undefined.
- t.SetUpType("IN_SCOPE_DEFINED", btAnything, AlwaysInScope|DefinedIfInScope,
+ t.SetUpVarType("IN_SCOPE_DEFINED", btAnything, AlwaysInScope|DefinedIfInScope,
"*.mk: use, use-loadtime")
- t.SetUpType("IN_SCOPE", btAnything, AlwaysInScope,
+ t.SetUpVarType("IN_SCOPE", btAnything, AlwaysInScope,
"*.mk: use, use-loadtime")
- t.SetUpType("PREFS_DEFINED", btAnything, DefinedIfInScope,
+ t.SetUpVarType("PREFS_DEFINED", btAnything, DefinedIfInScope,
"*.mk: use, use-loadtime")
- t.SetUpType("PREFS", btAnything, NoVartypeOptions,
+ t.SetUpVarType("PREFS", btAnything, NoVartypeOptions,
"*.mk: use, use-loadtime")
- t.SetUpType("LATER_DEFINED", btAnything, DefinedIfInScope,
+ t.SetUpVarType("LATER_DEFINED", btAnything, DefinedIfInScope,
"*.mk: use")
- t.SetUpType("LATER", btAnything, NoVartypeOptions,
+ t.SetUpVarType("LATER", btAnything, NoVartypeOptions,
"*.mk: use")
// UNDEFINED is also used in the following tests, but is obviously
// not defined here.
@@ -1132,6 +1132,33 @@ func (s *Suite) Test_MkCondChecker_simpl
".if ${IN_SCOPE_DEFINED:M\"}",
nil...)
+
+ // FIXME: Syntax error in the generated code.
+ testBeforeAndAfterPrefs(
+ ".if !empty(IN_SCOPE_DEFINED:M)",
+ ".if ${IN_SCOPE_DEFINED} == ",
+
+ "NOTE: filename.mk:3: IN_SCOPE_DEFINED can be "+
+ "compared using the simpler "+"\"${IN_SCOPE_DEFINED} == \" "+
+ "instead of matching against \":M\".",
+ "AUTOFIX: filename.mk:3: "+
+ "Replacing \"!empty(IN_SCOPE_DEFINED:M)\" "+
+ "with \"${IN_SCOPE_DEFINED} == \".",
+ )
+
+ // TODO: Suggest the simpler '${IN_SCOPE_DEFINED:M*.c}'.
+ testBeforeAndAfterPrefs(
+ ".if !empty(IN_SCOPE_DEFINED:M*.c)",
+ ".if !empty(IN_SCOPE_DEFINED:M*.c)",
+
+ nil...)
+
+ // TODO: Suggest the simpler '!${IN_SCOPE_DEFINED:M*.c}'.
+ testBeforeAndAfterPrefs(
+ ".if empty(IN_SCOPE_DEFINED:M*.c)",
+ ".if empty(IN_SCOPE_DEFINED:M*.c)",
+
+ nil...)
}
func (s *Suite) Test_MkCondChecker_simplify__defined_in_same_file(c *check.C) {
Index: pkgsrc/pkgtools/pkglint/files/mkline.go
diff -u pkgsrc/pkgtools/pkglint/files/mkline.go:1.84 pkgsrc/pkgtools/pkglint/files/mkline.go:1.85
--- pkgsrc/pkgtools/pkglint/files/mkline.go:1.84 Sun Jun 6 11:46:43 2021
+++ pkgsrc/pkgtools/pkglint/files/mkline.go Fri Jun 24 07:16:23 2022
@@ -83,7 +83,7 @@ func (mkline *MkLine) HasComment() bool
// and HOMEPAGE using http instead of https.
//
// To qualify as a rationale, the comment must contain any of the given
-// keywords. If no keywords are given, any comment qualifies.
+// keywords. If no keywords are given, any nonempty comment qualifies.
func (mkline *MkLine) HasRationale(keywords ...string) bool {
rationale := mkline.splitResult.rationale
if rationale == "" {
@@ -116,8 +116,9 @@ func (mkline *MkLine) HasRationale(keywo
// entirely, they still count as variable assignments, which means that
// their comment is the one after the value, if any.
//
-// Shell commands (lines that start with a tab) cannot have comments, as
-// the # characters are passed uninterpreted to the shell.
+// In shell commands (lines that start with a tab), comments can only start at
+// the beginning of a line, as the first non-whitespace character. Any later
+// '#' is passed uninterpreted to the shell.
//
// Example:
// VAR=value # comment
@@ -166,8 +167,9 @@ func (mkline *MkLine) IsVarassignMaybeCo
}
// IsShellCommand returns true for tab-indented lines that are assigned to a Make
-// target. Example:
+// target.
//
+// Example:
// pre-configure: # IsDependency
// ${ECHO} # IsShellCommand
func (mkline *MkLine) IsShellCommand() bool {
Index: pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go:1.15 pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go:1.16
--- pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go:1.15 Sun Jun 6 07:41:34 2021
+++ pkgsrc/pkgtools/pkglint/files/mkvarusechecker_test.go Fri Jun 24 07:16:23 2022
@@ -670,9 +670,9 @@ func (s *Suite) Test_MkVarUseChecker_che
t := s.Init(c)
t.SetUpPkgsrc()
- t.SetUpType("LOAD_TIME", BtPathPattern, List,
+ t.SetUpVarType("LOAD_TIME", BtPathPattern, List,
"special:filename.mk: use-loadtime")
- t.SetUpType("RUN_TIME", BtPathPattern, List,
+ t.SetUpVarType("RUN_TIME", BtPathPattern, List,
"special:filename.mk: use")
t.Chdir(".")
t.FinishSetUp()
@@ -694,9 +694,9 @@ func (s *Suite) Test_MkVarUseChecker_che
t := s.Init(c)
t.SetUpPkgsrc()
- t.SetUpType("LOAD_TIME", BtPathPattern, List,
+ t.SetUpVarType("LOAD_TIME", BtPathPattern, List,
"special:filename.mk: use-loadtime")
- t.SetUpType("RUN_TIME", BtPathPattern, List,
+ t.SetUpVarType("RUN_TIME", BtPathPattern, List,
"special:filename.mk: use")
t.Chdir(".")
t.FinishSetUp()
@@ -747,16 +747,16 @@ func (s *Suite) Test_MkVarUseChecker_che
t := s.Init(c)
t.SetUpPkgsrc()
- t.SetUpType("LOAD_TIME", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("LOAD_TIME", BtUnknown, NoVartypeOptions,
"*.mk: use, use-loadtime")
- t.SetUpType("RUN_TIME", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("RUN_TIME", BtUnknown, NoVartypeOptions,
"*.mk: use")
- t.SetUpType("WRITE_ONLY", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("WRITE_ONLY", BtUnknown, NoVartypeOptions,
"*.mk: set")
- t.SetUpType("LOAD_TIME_ELSEWHERE", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("LOAD_TIME_ELSEWHERE", BtUnknown, NoVartypeOptions,
"Makefile: use-loadtime",
"*.mk: set")
- t.SetUpType("RUN_TIME_ELSEWHERE", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("RUN_TIME_ELSEWHERE", BtUnknown, NoVartypeOptions,
"Makefile: use",
"*.mk: set")
t.Chdir(".")
@@ -852,7 +852,7 @@ func (s *Suite) Test_MkVarUseChecker_che
func (s *Suite) Test_MkVarUseChecker_checkPermissions__usable_only_at_loadtime_in_other_file(c *check.C) {
t := s.Init(c)
- t.SetUpType("VAR", BtFilename, NoVartypeOptions,
+ t.SetUpVarType("VAR", BtFilename, NoVartypeOptions,
"*: set, use-loadtime")
mklines := t.NewMkLines("Makefile",
MkCvsID,
@@ -871,8 +871,8 @@ func (s *Suite) Test_MkVarUseChecker_che
// This combination of BtUnknown and all permissions is typical for
// otherwise unknown variables from the pkgsrc infrastructure.
- t.SetUpType("INFRA", BtUnknown, NoVartypeOptions)
- t.SetUpType("VAR", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("INFRA", BtUnknown, NoVartypeOptions)
+ t.SetUpVarType("VAR", BtUnknown, NoVartypeOptions,
"buildlink3.mk: none",
"*: use")
mklines := t.NewMkLines("buildlink3.mk",
@@ -906,10 +906,10 @@ func (s *Suite) Test_MkVarUseChecker_che
// to use its value in LOAD_TIME, as the latter might be evaluated later
// at load time, and at that point VAR would be evaluated as well.
- t.SetUpType("LOAD_TIME", BtMessage, NoVartypeOptions,
+ t.SetUpVarType("LOAD_TIME", BtMessage, NoVartypeOptions,
"buildlink3.mk: set",
"*.mk: use-loadtime")
- t.SetUpType("VAR", BtUnknown, NoVartypeOptions,
+ t.SetUpVarType("VAR", BtUnknown, NoVartypeOptions,
"buildlink3.mk: none",
"*.mk: use")
mklines := t.NewMkLines("buildlink3.mk",
@@ -1090,7 +1090,7 @@ func (s *Suite) Test_MkVarUseChecker_che
t := s.Init(c)
btAnything := &BasicType{"Anything", func(cv *VartypeCheck) {}}
- t.SetUpType("PKG", btAnything, PackageSettable)
+ t.SetUpVarType("PKG", btAnything, PackageSettable)
t.Chdir("category/package")
test := func(filename CurrPath, diagnostics ...string) {
Index: pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go
diff -u pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.91 pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.92
--- pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go:1.91 Sat Jan 1 12:44:25 2022
+++ pkgsrc/pkgtools/pkglint/files/vartypecheck_test.go Fri Jun 24 07:16:23 2022
@@ -1621,7 +1621,7 @@ func (s *Suite) Test_VartypeCheck_Pathna
t := s.Init(c)
// Invent a variable name since this data type is only used as part
// of CONF_FILES.
- t.SetUpType("CONFIG_FILE", BtPathnameSpace,
+ t.SetUpVarType("CONFIG_FILE", BtPathnameSpace,
NoVartypeOptions, "*.mk: set, use")
vt := NewVartypeCheckTester(t, BtPathnameSpace)
Home |
Main Index |
Thread Index |
Old Index