Makefile: adjust lint target

Enable linter for examples, scripts and interop packages.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2024-10-10 11:33:07 +03:00
parent c5c64f5f07
commit 8bdb8afaf5

View file

@ -24,6 +24,9 @@ IMAGE_REPO=nspccdev/neo-go
DISABLE_NEOTEST_COVER=1 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 # All of the targets are phony here because we don't really use make dependency
# tracking for files # tracking for files
.PHONY: build $(BINARY) deps image docker/$(BINARY) image-latest image-push image-push-latest clean-cluster \ .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 curl -L -o $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml
lint: .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: fmt:
@gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/") @gofmt -l -w -s $$(find . -type f -name '*.go'| grep -v "/vendor/")