Skip to content

Commit 6a5c28f

Browse files
KPA experimental install
1 parent 44eabd5 commit 6a5c28f

File tree

22 files changed

+220
-0
lines changed

22 files changed

+220
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/cronjob-tutorial/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ $(ENVTEST): $(LOCALBIN)
232232
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
233233
$(GOLANGCI_LINT): $(LOCALBIN)
234234
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
235+
@echo "Running golangci-lint custom..."
236+
@$(LOCALBIN)/golangci-lint custom || { \
237+
echo "golangci-lint failed. Cleaning up..."; \
238+
rm -f $(LOCALBIN)/golangci-lint; \
239+
exit 1; \
240+
}
235241

236242
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
237243
# $1 - target path with name of binary
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/getting-started/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/getting-started/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ $(ENVTEST): $(LOCALBIN)
228228
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
229229
$(GOLANGCI_LINT): $(LOCALBIN)
230230
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
231+
@echo "Running golangci-lint custom..."
232+
@$(LOCALBIN)/golangci-lint custom || { \
233+
echo "golangci-lint failed. Cleaning up..."; \
234+
rm -f $(LOCALBIN)/golangci-lint; \
235+
exit 1; \
236+
}
231237

232238
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
233239
# $1 - target path with name of binary
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v2.0.0
2+
name: golangci-custom-linters
3+
destination: ./bin
4+
5+
plugins:
6+
- module: sigs.k8s.io/kube-api-linter
7+
version: latest

docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ linters:
2121
- unconvert
2222
- unparam
2323
- unused
24+
- kubeapilinter
2425
settings:
2526
revive:
2627
rules:
2728
- name: comment-spacings
2829
- name: import-shadowing
30+
custom:
31+
kubeapilinter:
32+
path: ./bin/golangci-custom-linters
33+
description: "Kube API Linter plugin"
34+
original-url: "sigs.k8s.io/kube-api-linter"
35+
settings:
36+
linters: {}
37+
lintersConfig: {}
2938
exclusions:
3039
generated: lax
3140
rules:
@@ -36,6 +45,9 @@ linters:
3645
- dupl
3746
- lll
3847
path: internal/*
48+
- path-except: "^api/"
49+
linters:
50+
- kubeapilinter
3951
paths:
4052
- third_party$
4153
- builtin$

docs/book/src/multiversion-tutorial/testdata/project/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ $(ENVTEST): $(LOCALBIN)
232232
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
233233
$(GOLANGCI_LINT): $(LOCALBIN)
234234
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
235+
@echo "Running golangci-lint custom..."
236+
@$(LOCALBIN)/golangci-lint custom || { \
237+
echo "golangci-lint failed. Cleaning up..."; \
238+
rm -f $(LOCALBIN)/golangci-lint; \
239+
exit 1; \
240+
}
235241

236242
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
237243
# $1 - target path with name of binary

pkg/plugins/golang/v4/scaffolds/init.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func (s *initScaffolder) Scaffold() error {
176176
&templates.DockerIgnore{},
177177
&templates.Readme{CommandName: s.commandName},
178178
&templates.Golangci{},
179+
&templates.CustomGcl{},
179180
&e2e.Test{},
180181
&e2e.WebhookTestUpdater{WireWebhook: false},
181182
&e2e.SuiteTest{},

0 commit comments

Comments
 (0)