diff options
author | rillig <rillig@pkgsrc.org> | 2016-12-13 00:58:06 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2016-12-13 00:58:06 +0000 |
commit | 23ab914fc5aa0193db30b1653571f5bca69fc055 (patch) | |
tree | f778bb8d139fc27b6d400e00d4e50977b82803f7 /pkgtools/pkglint/files/mkline.go | |
parent | 9609bc7d8abba8a3d39f5b097ebec93029cbf5fa (diff) | |
download | pkgsrc-23ab914fc5aa0193db30b1653571f5bca69fc055.tar.gz |
Updated pkglint to 5.4.13.
Changes since 5.4.12:
* Added check for unintended # comments, especially in HOMEPAGE
* Added check for quotes in COMMENT
* Fixed hardcoded package versions for PHP, Python, Lua, etc.
* Code cleanup in the tests
Diffstat (limited to 'pkgtools/pkglint/files/mkline.go')
-rw-r--r-- | pkgtools/pkglint/files/mkline.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgtools/pkglint/files/mkline.go b/pkgtools/pkglint/files/mkline.go index 30a70148bb8..6e46ffcabea 100644 --- a/pkgtools/pkglint/files/mkline.go +++ b/pkgtools/pkglint/files/mkline.go @@ -58,7 +58,7 @@ func NewMkLine(line *Line) (mkline *MkLine) { "white-space.") } - if m, varname, spaceAfterVarname, op, valueAlign, value, comment := MatchVarassign(text); m { + if m, varname, spaceAfterVarname, op, valueAlign, value, spaceAfterValue, comment := MatchVarassign(text); m { if G.opts.WarnSpace && spaceAfterVarname != "" { switch { case hasSuffix(varname, "+") && op == "=": @@ -72,6 +72,13 @@ func NewMkLine(line *Line) (mkline *MkLine) { } } + if comment != "" && value != "" && spaceAfterValue == "" { + line.Warnf("The # character starts a comment.") + Explain( + "In a variable assignment, an unescaped # starts a comment that", + "continues until the end of the line. To escape the #, write \\#.") + } + value = strings.Replace(value, "\\#", "#", -1) varparam := varnameParam(varname) |