From eb944bd261a1510ee7e7126813d42cf8936c9e64 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 21 May 2025 23:13:32 -0400 Subject: [PATCH] chore: update Makefile to install golangci-lint if not present and adjust lint command Signed-off-by: Deluan --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 38f1ca9ed..c2a81bde9 100644 --- a/Makefile +++ b/Makefile @@ -49,8 +49,12 @@ testall: testrace ##@Development Run Go and JS tests @(cd ./ui && npm run test:ci) .PHONY: testall -lint: ##@Development Lint Go code - go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run -v --timeout 5m +install-golangci-lint: ##@Development Install golangci-lint if not present + @which golangci-lint > /dev/null || (echo "Installing golangci-lint..." && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s v2.1.6) +.PHONY: install-golangci-lint + +lint: install-golangci-lint ##@Development Lint Go code + PATH=$$PATH:./bin golangci-lint run -v --timeout 5m .PHONY: lint lintall: lint ##@Development Lint Go and JS code