|
8 | 8 | GOBIN=$(shell go env GOBIN) |
9 | 9 | endif |
10 | 10 |
|
| 11 | +TOOLS_DIR := hack/tools |
11 | 12 | ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) |
12 | 13 |
|
13 | 14 | # CONTAINER_TOOL defines the container tool to be used for building images. |
@@ -101,13 +102,17 @@ cleanup-test-e2e: ## Tear down the Kind cluster used for e2e tests |
101 | 102 | @$(KIND) delete cluster --name $(KIND_CLUSTER) --kubeconfig $(KIND_KUBECONFIG) |
102 | 103 |
|
103 | 104 | .PHONY: lint |
104 | | -lint: lint-golangci-lint lint-nilaway ## Run linters |
| 105 | +lint: lint-api lint-golangci-lint lint-nilaway ## Run linters |
105 | 106 | @echo "done" |
106 | 107 |
|
107 | 108 | .PHONY: lint-golangci-lint |
108 | 109 | lint-golangci-lint: golangci-lint ## Run golangci-lint linter |
109 | 110 | $(GOLANGCI_LINT) run |
110 | 111 |
|
| 112 | +.PHONY: lint-api |
| 113 | +lint-api: golangci-lint-kube-api-linter ## Run golangci-lint-kube-api-linter linter |
| 114 | + $(GOLANGCI_LINT_KAL) run --config .golangci-kal.yml |
| 115 | + |
111 | 116 | .PHONY: lint-nilaway |
112 | 117 | lint-nilaway: nilaway ## Run nilaway linter |
113 | 118 | $(NILAWAY) -include-pkgs=github.com/scaleway/cluster-api-provider-scaleway ./... |
@@ -217,19 +222,20 @@ NILAWAY = $(LOCALBIN)/nilaway |
217 | 222 | MOCKGEN = $(LOCALBIN)/mockgen |
218 | 223 | ENVSUBST = $(LOCALBIN)/envsubst |
219 | 224 | GINKGO = $(LOCALBIN)/ginkgo |
| 225 | +GOLANGCI_LINT_KAL := $(LOCALBIN)/golangci-lint-kube-api-linter |
220 | 226 |
|
221 | 227 | ## Tool Versions |
222 | | -KUSTOMIZE_VERSION ?= v5.6.0 |
223 | | -CONTROLLER_TOOLS_VERSION ?= v0.18.0 |
| 228 | +KUSTOMIZE_VERSION ?= v5.7.1 |
| 229 | +CONTROLLER_TOOLS_VERSION ?= v0.19.0 |
224 | 230 | #ENVTEST_VERSION is the version of controller-runtime release branch to fetch the envtest setup script (i.e. release-0.20) |
225 | 231 | ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}') |
226 | 232 | #ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31) |
227 | 233 | ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}') |
228 | | -GOLANGCI_LINT_VERSION ?= v2.1.0 |
| 234 | +GOLANGCI_LINT_VERSION ?= v2.5.0 |
229 | 235 | NILAWAY_VERSION ?= latest |
230 | | -MOCKGEN_VERSION ?= v0.5.2 |
| 236 | +MOCKGEN_VERSION ?= v0.6.0 |
231 | 237 | ENVSUBST_VERSION ?=latest |
232 | | -GINKGO_VERSION ?= v2.23.4 |
| 238 | +GINKGO_VERSION ?= v2.25.3 |
233 | 239 |
|
234 | 240 | .PHONY: kustomize |
235 | 241 | kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. |
@@ -279,6 +285,11 @@ ginkgo: $(GINKGO) ## Download ginkgo locally if necessary. |
279 | 285 | $(GINKGO): $(LOCALBIN) |
280 | 286 | $(call go-install-tool,$(GINKGO),github.com/onsi/ginkgo/v2/ginkgo,$(GINKGO_VERSION)) |
281 | 287 |
|
| 288 | +.PHONY: golangci-lint-kube-api-linter |
| 289 | +golangci-lint-kube-api-linter: $(GOLANGCI_LINT_KAL) ## Build golangci-lint-kal from custom configuration. |
| 290 | +$(GOLANGCI_LINT_KAL): $(GOLANGCI_LINT) |
| 291 | + $(GOLANGCI_LINT) custom |
| 292 | + |
282 | 293 | # go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist |
283 | 294 | # $1 - target path with name of binary |
284 | 295 | # $2 - package url which can be installed |
|
0 commit comments