From 8bdb8afaf597b7824acabfd359f18e39a5db00cb Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 10 Oct 2024 11:33:07 +0300 Subject: [PATCH] Makefile: adjust lint target Enable linter for examples, scripts and interop packages. Signed-off-by: Anna Shaleva --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 82194ce04..0dcd98393 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ IMAGE_REPO=nspccdev/neo-go DISABLE_NEOTEST_COVER=1 +ROOT_DIR:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) +GOMODDIRS=$(dir $(shell find $(ROOT_DIR) -name go.mod)) + # All of the targets are phony here because we don't really use make dependency # tracking for files .PHONY: build $(BINARY) deps image docker/$(BINARY) image-latest image-push image-push-latest clean-cluster \ @@ -113,7 +116,9 @@ vet: curl -L -o $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml lint: .golangci.yml - @golangci-lint run + @for dir in $(GOMODDIRS); do \ + (cd "$$dir" && golangci-lint run --config $(ROOT_DIR)/$< | sed -r "s,^,$$dir," | sed -r "s,^$(ROOT_DIR),,") \ + done fmt: @gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")