Skip to content

Commit 7400916

Browse files
committed
fix Makefile
1 parent 99a308c commit 7400916

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,15 @@ test: manifests generate fmt vet envtest ## Run tests.
7979
go tool cover --html=cover.out -o cover.html
8080
go tool cover -func cover.out | tail -n 1
8181

82+
.PHONY: golangci-lint
83+
golangci-lint: localbin ## Download golangci-lint locally if necessary. If wrong version is installed, it will be overwritten.
84+
@test -s $(LINTER) && $(LINTER) --version | grep -q $(subst v,,$(LINTER_VERSION)) || \
85+
( echo "Installing golangci-lint $(LINTER_VERSION) ..."; \
86+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(LOCALBIN) $(LINTER_VERSION) )
87+
88+
8289
.PHONY: lint
83-
lint: ## Run golangci-lint to lint code
90+
lint:golangci-lint ## Run golangci-lint to lint code
8491
golangci-lint run ./... --timeout=15m
8592

8693
.PHONY: tidy

0 commit comments

Comments
 (0)