From 9fa0f074156f8c5729502f1d2006e3125c50e9c1 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Tue, 6 Dec 2022 11:23:45 -0800 Subject: [PATCH] :seedling: Update golangci-lint to v1.50.1 Signed-off-by: Vince Prignano --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 7 ------- pkg/builder/webhook_test.go | 2 +- pkg/client/apiutil/apimachinery.go | 2 +- pkg/controller/controllerutil/controllerutil.go | 2 +- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 4e2f1211ed..cfa9a917cf 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,5 +19,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.49.0 + version: v1.50.1 working-directory: ${{matrix.working-directory}} diff --git a/.golangci.yml b/.golangci.yml index 7d1d3665ce..209b7f4e63 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,7 +3,6 @@ linters: enable: - asciicheck - bodyclose - - deadcode - depguard - dogsled - errcheck @@ -18,7 +17,6 @@ linters: - gosec - gosimple - govet - - ifshort - importas - ineffassign - misspell @@ -29,19 +27,14 @@ linters: - revive - rowserrcheck - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace linters-settings: - ifshort: - # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. - max-decl-chars: 50 importas: no-unaliased: true alias: diff --git a/pkg/builder/webhook_test.go b/pkg/builder/webhook_test.go index 4282366842..3d5f4f1d9a 100644 --- a/pkg/builder/webhook_test.go +++ b/pkg/builder/webhook_test.go @@ -892,7 +892,7 @@ func (*TestCustomValidator) ValidateUpdate(ctx context.Context, oldObj, newObj r } v := newObj.(*TestValidator) - old := oldObj.(*TestValidator) //nolint:ifshort + old := oldObj.(*TestValidator) if v.Replica < 0 { return errors.New("number of replica should be greater than or equal to 0") } diff --git a/pkg/client/apiutil/apimachinery.go b/pkg/client/apiutil/apimachinery.go index c92b0eaaec..3055f4c4fb 100644 --- a/pkg/client/apiutil/apimachinery.go +++ b/pkg/client/apiutil/apimachinery.go @@ -81,7 +81,7 @@ func GVKForObject(obj runtime.Object, scheme *runtime.Scheme) (schema.GroupVersi // (unstructured, partial, etc) // check for PartialObjectMetadata, which is analogous to unstructured, but isn't handled by ObjectKinds - _, isPartial := obj.(*metav1.PartialObjectMetadata) //nolint:ifshort + _, isPartial := obj.(*metav1.PartialObjectMetadata) _, isPartialList := obj.(*metav1.PartialObjectMetadataList) if isPartial || isPartialList { // we require that the GVK be populated in order to recognize the object diff --git a/pkg/controller/controllerutil/controllerutil.go b/pkg/controller/controllerutil/controllerutil.go index aa53a77d41..99974eb959 100644 --- a/pkg/controller/controllerutil/controllerutil.go +++ b/pkg/controller/controllerutil/controllerutil.go @@ -207,7 +207,7 @@ func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, f M return OperationResultCreated, nil } - existing := obj.DeepCopyObject() //nolint + existing := obj.DeepCopyObject() if err := mutate(f, key, obj); err != nil { return OperationResultNone, err }