You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Makefile
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,13 @@ $(KUSTOMIZE): $(LOCALBIN)
78
78
fi
79
79
test -s $(LOCALBIN)/kustomize || GOBIN=$(LOCALBIN) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION)
80
80
81
+
$(GOLANGCILINT): $(LOCALBIN)
82
+
@if test -x $(LOCALBIN)/golangci-lint &&!$(LOCALBIN)/golangci-lint version | grep -q $(GOLANGCILINT_VERSION);then\
83
+
echo"$(LOCALBIN)/golangci-lint version is not expected $(GOLANGCILINT_VERSION). Removing it before installing.";\
84
+
rm -rf $(LOCALBIN)/golangci-lint;\
85
+
fi
86
+
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) GO111MODULE=on go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCILINT_VERSION)
87
+
81
88
.PHONY: controller-gen
82
89
controller-gen: $(CONTROLLER_GEN)## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
83
90
$(CONTROLLER_GEN): $(LOCALBIN)
@@ -104,7 +111,7 @@ lint: $(GOLANGCILINT) ## Run golangci-lint against code.
104
111
$(GOLANGCILINT) run ./...
105
112
106
113
.PHONY: lint-fix
107
-
lint-fix: ## Run golangci-lint with --fix option to automatically fix issues.
114
+
lint-fix: $(GOLANGCILINT)## Run golangci-lint with --fix option to automatically fix issues.
0 commit comments