Skip to content

Commit 8bdb8af

Browse files
committed
Makefile: adjust lint target
Enable linter for examples, scripts and interop packages. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
1 parent c5c64f5 commit 8bdb8af

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ IMAGE_REPO=nspccdev/neo-go
2424

2525
DISABLE_NEOTEST_COVER=1
2626

27+
ROOT_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
28+
GOMODDIRS=$(dir $(shell find $(ROOT_DIR) -name go.mod))
29+
2730
# All of the targets are phony here because we don't really use make dependency
2831
# tracking for files
2932
.PHONY: build $(BINARY) deps image docker/$(BINARY) image-latest image-push image-push-latest clean-cluster \
@@ -113,7 +116,9 @@ vet:
113116
curl -L -o $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml
114117

115118
lint: .golangci.yml
116-
@golangci-lint run
119+
@for dir in $(GOMODDIRS); do \
120+
(cd "$$dir" && golangci-lint run --config $(ROOT_DIR)/$< | sed -r "s,^,$$dir," | sed -r "s,^$(ROOT_DIR),,") \
121+
done
117122

118123
fmt:
119124
@gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")

0 commit comments

Comments
 (0)