File tree Expand file tree Collapse file tree 4 files changed +57
-0
lines changed
Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ version : v2.5.0
2+ name : golangci-lint-kube-api-linter
3+ destination : ./bin
4+ plugins :
5+ - module : ' sigs.k8s.io/kube-api-linter'
6+ version : ' v0.0.0-20251103104136-5fca1e8b5e9f'
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
2+ # SPDX-License-Identifier: Apache-2.0
3+ version : " 2"
4+ linters :
5+ default : none
6+ enable :
7+ - kubeapilinter # linter for Kube API conventions
8+ settings :
9+ custom :
10+ kubeapilinter :
11+ type : module
12+ description : KAL is the Kube-API-Linter and lints Kube like APIs based on API conventions and best practices.
13+ settings :
14+ linters : {}
15+ lintersConfig :
16+ conditions :
17+ useProtobuf : Forbid
18+ optionalfields :
19+ pointers :
20+ preference : WhenRequired
21+
22+ exclusions :
23+ generated : strict
24+ paths :
25+ - " .*_test.go"
26+ - " zz_generated.*.go"
27+ rules :
28+ - path-except : " ^api/"
29+ linters :
30+ - kubeapilinter
31+ issues :
32+ max-same-issues : 0
33+ max-issues-per-linter : 0
Original file line number Diff line number Diff line change @@ -53,6 +53,15 @@ fmt: FORCE install-gofumpt
5353 @printf " \e[1;36m>> gofumpt -l -w .\e[0m\n"
5454 @gofumpt -l -w $(shell git ls-files '* .go' | grep -v '^internal/provider/openconfig')
5555
56+ bin/golangci-lint-kube-api-linter :
57+ @printf " \e[1;36m>> Installing golangci-lint-kube-api-linter...\e[0m\n"
58+ @golangci-lint custom
59+
60+ lint-api : FORCE bin/golangci-lint-kube-api-linter
61+ @printf " \e[1;36m>> bin/golangci-lint-kube-api-linter run --config=.golangci-kal.yaml\e[0m\n"
62+ @bin/golangci-lint-kube-api-linter config verify --config=.golangci-kal.yaml
63+ @bin/golangci-lint-kube-api-linter run --config=.golangci-kal.yaml
64+
5665# Run the e2e tests against a k8s cluster.
5766test-e2e : FORCE
5867 @command -v kind > /dev/null 2>&1 || { \
Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ verbatim: |
8080 @printf "\e[1;36m>> gofumpt -l -w .\e[0m\n"
8181 @gofumpt -l -w $(shell git ls-files '*.go' | grep -v '^internal/provider/openconfig')
8282
83+ bin/golangci-lint-kube-api-linter:
84+ @printf "\e[1;36m>> Installing golangci-lint-kube-api-linter...\e[0m\n"
85+ @golangci-lint custom
86+
87+ lint-api: FORCE bin/golangci-lint-kube-api-linter
88+ @printf "\e[1;36m>> bin/golangci-lint-kube-api-linter run --config=.golangci-kal.yaml\e[0m\n"
89+ @bin/golangci-lint-kube-api-linter config verify --config=.golangci-kal.yaml
90+ @bin/golangci-lint-kube-api-linter run --config=.golangci-kal.yaml
91+
8392 # Run the e2e tests against a k8s cluster.
8493 test-e2e: FORCE
8594 @command -v kind >/dev/null 2>&1 || { \
You can’t perform that action at this time.
0 commit comments