Skip to content

Commit cdead37

Browse files
cibomahtodeadprogram
authored andcommitted
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 deb48dd commit cdead37

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GNUmakefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,14 +1098,18 @@ endif
10981098
tools:
10991099
cd internal/tools && go generate -tags tools ./
11001100

1101+
LINTFILESCMD=find src/os/ src/reflect/ -type f -name '*.go'
11011102
.PHONY: lint
11021103
lint: tools ## Lint source tree
11031104
revive -version
11041105
# TODO: lint more directories!
11051106
# revive.toml isn't flexible enough to filter out just one kind of error from a checker, so do it with grep here.
11061107
# Can't use grep with friendly formatter. Plain output isn't too bad, though.
11071108
# Use 'grep .' to get rid of stray blank line
1108-
revive -config revive.toml compiler/... src/{os,reflect}/*.go | grep -v "should have comment or be unexported" | grep '.' | awk '{print}; END {exit NR>0}'
1109+
revive -config revive.toml compiler/... $$( $(LINTFILESCMD) ) \
1110+
| grep -v "should have comment or be unexported" \
1111+
| grep '.' \
1112+
| awk '{print}; END {exit NR>0}'
11091113

11101114
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
11111115
.PHONY: spell

0 commit comments

Comments
 (0)