Skip to content

Commit 384a5f7

Browse files
committed
Add makefile entries for api-lint
1 parent bc242de commit 384a5f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ test-e2e: ## Run end-to-end tests against an existing Kubernetes cluster.
152152
lint: golangci-lint ## Run golangci-lint linter
153153
$(GOLANGCI_LINT) run --timeout 5m
154154

155+
.PHONY: api-lint
156+
api-lint: golangci-lint ## Run golangci-kube-api-linter
157+
155158
.PHONY: lint-fix
156159
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
157160
$(GOLANGCI_LINT) run --fix
@@ -160,8 +163,12 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
160163
ci-lint: golangci-lint
161164
$(GOLANGCI_LINT) run --timeout 15m0s
162165

166+
.PHONY: api-lint
167+
api-lint: golangci-api-lint
168+
$(GOLANGCI_API_LINT) run -c .golangci-kal.yml --timeout 15m0s ./...
169+
163170
.PHONY: verify
164-
verify: vet fmt-verify generate ci-lint verify-all
171+
verify: vet fmt-verify generate ci-lint api-lint verify-all
165172
git --no-pager diff --exit-code config api client-go
166173

167174
.PHONY: verify-crds
@@ -365,6 +372,7 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
365372
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
366373
ENVTEST ?= $(LOCALBIN)/setup-envtest
367374
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
375+
GOLANGCI_API_LINT = $(LOCALBIN)/golangci-kube-api-linter
368376
HELM = $(PROJECT_DIR)/bin/helm
369377
YQ = $(PROJECT_DIR)/bin/yq
370378
KUBECTL_VALIDATE = $(PROJECT_DIR)/bin/kubectl-validate
@@ -399,6 +407,11 @@ golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
399407
$(GOLANGCI_LINT): $(LOCALBIN)
400408
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
401409

410+
.PHONY: golangci-api-lint
411+
golangci-api-lint: golangci-lint $(GOLANGCI_API_LINT) ## Download golangci-lint locally if necessary before building KAL
412+
$(GOLANGCI_API_LINT):
413+
$(GOLANGCI_LINT) custom
414+
402415
.PHONY: yq
403416
yq: ## Download yq locally if necessary.
404417
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install github.com/mikefarah/yq/[email protected]

0 commit comments

Comments
 (0)