Skip to content

Commit 22ce3ac

Browse files
Upgrade GolangCI-Lint to Latest Version (v2.0.2)
1 parent 5307272 commit 22ce3ac

File tree

17 files changed

+19
-22
lines changed

17 files changed

+19
-22
lines changed

.github/workflows/lint-sample.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
working-directory: ${{ matrix.folder }}
3737
run: make lint-config
3838
- name: Run linter
39-
uses: golangci/golangci-lint-action@v6
39+
uses: golangci/golangci-lint-action@v7
4040
with:
41-
version: v1.63.4
41+
version: v2.0.2
4242
working-directory: ${{ matrix.folder }}
4343
args: --config .golangci.yml ./...
4444
- name: Run linter via makefile target

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
- name: Check linter configuration
2525
run: make lint-config
2626
- name: Run linter
27-
uses: golangci/golangci-lint-action@v6
27+
uses: golangci/golangci-lint-action@v7
2828
with:
29-
version: v1.63.4
29+
version: v2.0.2
3030

3131
yamllint:
3232
runs-on: ubuntu-latest

.golangci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
run:
23
timeout: 5m
34
allow-parallel-runners: true
@@ -73,9 +74,6 @@ linters:
7374
- ginkgolinter
7475
- goconst
7576
- gocyclo
76-
- gofmt
77-
- goimports
78-
- gosimple
7977
- govet
8078
- ineffassign
8179
- lll
@@ -85,7 +83,6 @@ linters:
8583
- prealloc
8684
- revive
8785
- staticcheck
88-
- typecheck
8986
- unconvert
9087
- unparam
9188
- unused

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
125125
golangci-lint:
126126
@[ -f $(GOLANGCI_LINT) ] || { \
127127
set -e ;\
128-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.63.4 ;\
128+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v2.0.2 ;\
129129
}
130130

131131
.PHONY: apidiff

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

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

+1-1
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.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

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

+1-1
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.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

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

+1-1
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.

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

+1-1
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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

testdata/project-v4-multigroup/Makefile

+1-1
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.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

testdata/project-v4-with-plugins/Makefile

+1-1
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.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- name: Run linter
2121
uses: golangci/golangci-lint-action@v6
2222
with:
23-
version: v1.63.4
23+
version: v2.0.2

testdata/project-v4/Makefile

+1-1
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.

0 commit comments

Comments
 (0)