Skip to content

Commit

Permalink
🌱 Update golangci-lint to v1.50.1
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <vince@prigna.com>
  • Loading branch information
vincepri committed Dec 6, 2022
1 parent f40b846 commit 6d31879
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Expand Up @@ -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}}
7 changes: 0 additions & 7 deletions .golangci.yml
Expand Up @@ -3,7 +3,6 @@ linters:
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
Expand All @@ -18,7 +17,6 @@ linters:
- gosec
- gosimple
- govet
- ifshort
- importas
- ineffassign
- misspell
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/webhook_test.go
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/apiutil/apimachinery.go
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/controllerutil/controllerutil.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 6d31879

Please sign in to comment.