Skip to content

Commit d2663fd

Browse files
committed
Fix for #4678: top-level 'make lint' wasn't working
The revive command seems to have had a syntax error in the file input glob. It appears to have been broken in a way that did not result in a return code being set. This change uses 'find' to build the input to the linter. Note that it is expected to fail the CI script, because it is uncovering some existing lint issues that were not being caught.
1 parent 0426a5f commit d2663fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GNUmakefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -1000,14 +1000,18 @@ endif
10001000
tools:
10011001
cd internal/tools && go generate -tags tools ./
10021002

1003+
LINTFILESCMD=find src/os/ src/reflect/ -type f -name '*.go'
10031004
.PHONY: lint
10041005
lint: tools ## Lint source tree
10051006
revive -version
10061007
# TODO: lint more directories!
10071008
# revive.toml isn't flexible enough to filter out just one kind of error from a checker, so do it with grep here.
10081009
# Can't use grep with friendly formatter. Plain output isn't too bad, though.
10091010
# Use 'grep .' to get rid of stray blank line
1010-
revive -config revive.toml compiler/... src/{os,reflect}/*.go | grep -v "should have comment or be unexported" | grep '.' | awk '{print}; END {exit NR>0}'
1011+
revive -config revive.toml compiler/... $$( $(LINTFILESCMD) ) \
1012+
| grep -v "should have comment or be unexported" \
1013+
| grep '.' \
1014+
| awk '{print}; END {exit NR>0}'
10111015

10121016
SPELLDIRSCMD=find . -depth 1 -type d | egrep -wv '.git|lib|llvm|src'; find src -depth 1 | egrep -wv 'device|internal|net|vendor'; find src/internal -depth 1 -type d | egrep -wv src/internal/wasi
10131017
.PHONY: spell

0 commit comments

Comments
 (0)