Skip to content

Commit a7f6e03

Browse files
✨ Upgrade golangci from 1.54 to 1.57 (#3846)
* Upgrade golangci from 1.54 to 1.57 * Fix lint issues after upgrade by: a) Ensure that in all places we are ignoring the exception equally ```go // nolint:revive . "github.com/onsi/ginkgo/v2" // nolint:revive . "github.com/onsi/gomega" ``` b) Ensure that we use `_` for args not explicit called in the funcs. Example ```go PreRunE: func(_ *cobra.Command, _ []string) error { ```
1 parent 6bcd440 commit a7f6e03

File tree

194 files changed

+366
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+366
-78
lines changed

.github/workflows/lint-sample.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ jobs:
4040
- name: Run linter
4141
uses: golangci/golangci-lint-action@v4
4242
with:
43-
version: v1.54
43+
version: v1.57
4444
working-directory: testdata/project-v4-with-deploy-image
4545
args: --config .golangci.yml ./...
4646
skip-cache: true # first lint action will handle
4747
- name: Run linter
4848
uses: golangci/golangci-lint-action@v4
4949
with:
50-
version: v1.54
50+
version: v1.57
5151
working-directory: testdata/project-v4-multigroup-with-deploy-image
5252
args: --config .golangci.yml ./...
5353
skip-cache: true # first lint action will handle

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Run linter
2222
uses: golangci/golangci-lint-action@v4
2323
with:
24-
version: v1.54
24+
version: v1.57
2525

2626
yamllint:
2727
runs-on: ubuntu-latest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
104104
golangci-lint:
105105
@[ -f $(GOLANGCI_LINT) ] || { \
106106
set -e ;\
107-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.54.2 ;\
107+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.57.2 ;\
108108
}
109109

110110
.PHONY: apidiff

docs/book/src/component-config-tutorial/testdata/project/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
161161
KUSTOMIZE_VERSION ?= v5.3.0
162162
CONTROLLER_TOOLS_VERSION ?= v0.14.0
163163
ENVTEST_VERSION ?= release-0.17
164-
GOLANGCI_LINT_VERSION ?= v1.54.2
164+
GOLANGCI_LINT_VERSION ?= v1.57.2
165165

166166
.PHONY: kustomize
167167
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.

docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_suite_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ import (
2020
"fmt"
2121
"testing"
2222

23+
// nolint:revive
2324
. "github.com/onsi/ginkgo/v2"
25+
// nolint:revive
2426
. "github.com/onsi/gomega"
2527
)
2628

docs/book/src/component-config-tutorial/testdata/project/test/e2e/e2e_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import (
2121
"os/exec"
2222
"time"
2323

24+
// nolint:revive
2425
. "github.com/onsi/ginkgo/v2"
26+
// nolint:revive
2527
. "github.com/onsi/gomega"
2628

2729
"tutorial.kubebuilder.io/project/test/utils"

docs/book/src/component-config-tutorial/testdata/project/test/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"os/exec"
2323
"strings"
2424

25+
// nolint:revive
2526
. "github.com/onsi/ginkgo/v2" //nolint:golint,revive
2627
)
2728

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
161161
KUSTOMIZE_VERSION ?= v5.3.0
162162
CONTROLLER_TOOLS_VERSION ?= v0.14.0
163163
ENVTEST_VERSION ?= release-0.17
164-
GOLANGCI_LINT_VERSION ?= v1.54.2
164+
GOLANGCI_LINT_VERSION ?= v1.57.2
165165

166166
.PHONY: kustomize
167167
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.

docs/book/src/cronjob-tutorial/testdata/project/api/v1/cronjob_webhook_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1
1818

1919
import (
20+
// nolint:revive
2021
. "github.com/onsi/ginkgo/v2"
2122
)
2223

docs/book/src/cronjob-tutorial/testdata/project/api/v1/webhook_suite_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ import (
2626
"testing"
2727
"time"
2828

29+
// nolint:revive
2930
. "github.com/onsi/ginkgo/v2"
31+
// nolint:revive
3032
. "github.com/onsi/gomega"
31-
3233
admissionv1 "k8s.io/api/admission/v1"
34+
3335
//+kubebuilder:scaffold:imports
3436
apimachineryruntime "k8s.io/apimachinery/pkg/runtime"
3537
"k8s.io/client-go/rest"

0 commit comments

Comments
 (0)