Skip to content

Commit 33643a2

Browse files
committed
add lint v2.0.2
Signed-off-by: dongjiang <[email protected]>
1 parent 96a951a commit 33643a2

File tree

14 files changed

+32
-26
lines changed

14 files changed

+32
-26
lines changed

docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
182182
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
183183
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
184184
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
185-
GOLANGCI_LINT_VERSION ?= v1.63.4
185+
GOLANGCI_LINT_VERSION ?= v2.0.2
186186

187187
.PHONY: kustomize
188188
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -210,7 +210,7 @@ $(ENVTEST): $(LOCALBIN)
210210
.PHONY: golangci-lint
211211
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
212212
$(GOLANGCI_LINT): $(LOCALBIN)
213-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
213+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
214214

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

docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
178178
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
179179
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
180180
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
181-
GOLANGCI_LINT_VERSION ?= v1.63.4
181+
GOLANGCI_LINT_VERSION ?= v2.0.2
182182

183183
.PHONY: kustomize
184184
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -206,7 +206,7 @@ $(ENVTEST): $(LOCALBIN)
206206
.PHONY: golangci-lint
207207
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
208208
$(GOLANGCI_LINT): $(LOCALBIN)
209-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
209+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
210210

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

docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
182182
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
183183
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
184184
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
185-
GOLANGCI_LINT_VERSION ?= v1.63.4
185+
GOLANGCI_LINT_VERSION ?= v2.0.2
186186

187187
.PHONY: kustomize
188188
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -210,7 +210,7 @@ $(ENVTEST): $(LOCALBIN)
210210
.PHONY: golangci-lint
211211
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
212212
$(GOLANGCI_LINT): $(LOCALBIN)
213-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
213+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
214214

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838

3939
const (
4040
// GolangciLintVersion is the golangci-lint version to be used in the project
41-
GolangciLintVersion = "v1.63.4"
41+
GolangciLintVersion = "v2.0.2"
4242
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
4343
ControllerRuntimeVersion = "v0.20.4"
4444
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project

pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ $(ENVTEST): $(LOCALBIN)
285285
.PHONY: golangci-lint
286286
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
287287
$(GOLANGCI_LINT): $(LOCALBIN)
288-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
288+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
289289
290290
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
291291
# $1 - target path with name of binary

testdata/project-v4-multigroup/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

testdata/project-v4-multigroup/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
178178
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
179179
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
180180
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
181-
GOLANGCI_LINT_VERSION ?= v1.63.4
181+
GOLANGCI_LINT_VERSION ?= v2.0.2
182182

183183
.PHONY: kustomize
184184
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -206,7 +206,7 @@ $(ENVTEST): $(LOCALBIN)
206206
.PHONY: golangci-lint
207207
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
208208
$(GOLANGCI_LINT): $(LOCALBIN)
209-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
209+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
210210

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

testdata/project-v4-with-plugins/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

testdata/project-v4-with-plugins/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
178178
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
179179
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
180180
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
181-
GOLANGCI_LINT_VERSION ?= v1.63.4
181+
GOLANGCI_LINT_VERSION ?= v2.0.2
182182

183183
.PHONY: kustomize
184184
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -206,7 +206,7 @@ $(ENVTEST): $(LOCALBIN)
206206
.PHONY: golangci-lint
207207
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
208208
$(GOLANGCI_LINT): $(LOCALBIN)
209-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
209+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
210210

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

testdata/project-v4/.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
go-version-file: go.mod
1919

2020
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
uses: golangci/golangci-lint-action@v7
2222
with:
23-
version: v1.63.4
23+
install-mode: goinstall
24+
version: v2.0.2

testdata/project-v4/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.2
178178
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
179179
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
180180
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
181-
GOLANGCI_LINT_VERSION ?= v1.63.4
181+
GOLANGCI_LINT_VERSION ?= v2.0.2
182182

183183
.PHONY: kustomize
184184
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -206,7 +206,7 @@ $(ENVTEST): $(LOCALBIN)
206206
.PHONY: golangci-lint
207207
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
208208
$(GOLANGCI_LINT): $(LOCALBIN)
209-
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
209+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
210210

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

0 commit comments

Comments
 (0)