Skip to content

Commit 0ca0aad

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 3ddba4e commit 0ca0aad

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
@@ -1118,14 +1118,18 @@ endif
11181118
tools:
11191119
cd internal/tools && go generate -tags tools ./
11201120

1121+
LINTFILESCMD=find src/os/ src/reflect/ -type f -name '*.go'
11211122
.PHONY: lint
11221123
lint: tools ## Lint source tree
11231124
revive -version
11241125
# TODO: lint more directories!
11251126
# revive.toml isn't flexible enough to filter out just one kind of error from a checker, so do it with grep here.
11261127
# Can't use grep with friendly formatter. Plain output isn't too bad, though.
11271128
# Use 'grep .' to get rid of stray blank line
1128-
revive -config revive.toml compiler/... src/{os,reflect}/*.go | grep -v "should have comment or be unexported" | grep '.' | awk '{print}; END {exit NR>0}'
1129+
revive -config revive.toml compiler/... $$( $(LINTFILESCMD) ) \
1130+
| grep -v "should have comment or be unexported" \
1131+
| grep '.' \
1132+
| awk '{print}; END {exit NR>0}'
11291133

11301134
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
11311135
.PHONY: spell

0 commit comments

Comments
 (0)