fix: remove duplication in Makefile

This commit is contained in:
Michael Kuhnt 2024-11-26 15:04:53 +01:00
parent 8e13588edd
commit 53bc1eedce

View file

@ -57,17 +57,6 @@ create-release-files:
release: build-static create-release-files ## Create a release release: build-static create-release-files ## Create a release
##@ Lint / Verify ##@ Lint / Verify
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
## Tool Versions
GOLANGCI_LINT_VERSION ?= v1.61.0
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. If wrong version is installed, it will be overwritten.
$(GOLANGCI_LINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint && $(LOCALBIN)/golangci-lint --version | grep -q $(GOLANGCI_LINT_VERSION) || \
GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
.PHONY: lint .PHONY: lint
lint: golangci-lint $(GOLANGCI_LINT) ## Run linting. lint: golangci-lint $(GOLANGCI_LINT) ## Run linting.
$(GOLANGCI_LINT) run -v --build-tags=testing,integration $(GOLANGCI_LINT_EXTRA_ARGS) $(GOLANGCI_LINT) run -v --build-tags=testing,integration $(GOLANGCI_LINT_EXTRA_ARGS)
@ -117,7 +106,7 @@ $(LOCALBIN):
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
## Tool Versions ## Tool Versions
GOLANGCI_LINT_VERSION ?= v1.56.2 GOLANGCI_LINT_VERSION ?= v1.61.0
.PHONY: golangci-lint .PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. If wrong version is installed, it will be overwritten. golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary. If wrong version is installed, it will be overwritten.