Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Update golangci-lint to v1.50.1 #2080

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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