diff --git a/.github/workflows/pr-golangci-lint.yaml b/.github/workflows/pr-golangci-lint.yaml index 8f50ca37bb..6a0273e5da 100644 --- a/.github/workflows/pr-golangci-lint.yaml +++ b/.github/workflows/pr-golangci-lint.yaml @@ -23,5 +23,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # tag=v3.7.0 with: - version: v1.54.1 + version: v1.55.2 args: --out-format=colored-line-number diff --git a/.golangci.yml b/.golangci.yml index 7866b6cf41..620fc67a20 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -170,6 +170,8 @@ linters-settings: ginkgolinter: forbid-focus-container: true + goconst: + ignore-tests: true issues: max-same-issues: 0 @@ -211,7 +213,17 @@ issues: - linters: - revive - stylecheck - path: test/.*.go + path: _test\.go + text: should not use dot imports + - linters: + - revive + - stylecheck + path: test/e2e/.*.go + text: should not use dot imports + - linters: + - revive + - stylecheck + path: test/helpers/vmware/.*.go text: should not use dot imports # Append should be able to assign to a different var/slice. - linters: diff --git a/pkg/identity/identity_test.go b/pkg/identity/identity_test.go index da07477200..74145c3d42 100644 --- a/pkg/identity/identity_test.go +++ b/pkg/identity/identity_test.go @@ -115,7 +115,7 @@ var _ = Describe("GetCredentials", func() { if labels == nil { labels = map[string]string{} } - labels["identity-authorized"] = "true" //nolint: goconst + labels["identity-authorized"] = "true" ns.Labels = labels Expect(k8sclient.Update(ctx, ns)).To(Succeed()) diff --git a/pkg/services/govmomi/util_test.go b/pkg/services/govmomi/util_test.go index 1bf608ecd2..12ee4c1e15 100644 --- a/pkg/services/govmomi/util_test.go +++ b/pkg/services/govmomi/util_test.go @@ -80,7 +80,8 @@ func Test_ShouldRetryTask(t *testing.T) { {baseTask(types.TaskInfoStateRunning, ""), false}, {baseTask(types.TaskInfoStateSuccess, ""), true}, } - for _, tt := range tests { + for i := range tests { + tt := tests[i] t.Run(fmt.Sprintf("state: %s", tt.task.Info.State), func(t *testing.T) { g = NewWithT(t) reconciled, err := checkAndRetryTask(vmCtx, &tt.task)