enable linter on repository

This commit is contained in:
Sergey Kanzhelev
2025-08-13 16:12:41 +00:00
parent dea6d70d46
commit a4118329f6
8 changed files with 67 additions and 2 deletions
+13 -1
View File
@@ -15,7 +15,7 @@
# Build the node-problem-detector image.
.PHONY: all \
vet fmt version test e2e-test \
lint vet fmt version test e2e-test \
build-binaries build-container build-tar build \
docker-builder build-in-docker \
push-container push-tar push release clean depup \
@@ -113,6 +113,18 @@ else
LOGCOUNTER=*dont-include-log-counter
endif
GOLANGCI_LINT_VERSION := v2.2.0
GOLANGCI_LINT := ./.bin/golangci-lint
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --config .golangci.yml ./...
$(GOLANGCI_LINT):
@echo "golangci-lint not found, downloading..."
@mkdir -p ./.bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./.bin $(GOLANGCI_LINT_VERSION)
vet:
go list -tags "$(HOST_PLATFORM_BUILD_TAGS)" ./... | \
grep -v "./vendor/*" | \