Skip to content

Commit

Permalink
chore: enable unnecessary-stmt from revive
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 committed Feb 8, 2025
1 parent 0bf2252 commit 9010d9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ linters-settings:
- name: unexported-return
disabled: true
- name: unnecessary-stmt
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true
Expand Down
11 changes: 3 additions & 8 deletions internal/resourcemodifiers/strategic_merge_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,9 @@ func applyPatchToObject(
})
}
} else if len(strictErrs) > 0 {
switch {
//case validationDirective == metav1.FieldValidationWarn:
// addStrictDecodingWarnings(requestContext, strictErrs)
default:
return apierrors.NewInvalid(schema.GroupKind{}, "", field.ErrorList{
field.Invalid(field.NewPath("patch"), fmt.Sprintf("%+v", patchMap), runtime.NewStrictDecodingError(strictErrs).Error()),
})
}
return apierrors.NewInvalid(schema.GroupKind{}, "", field.ErrorList{
field.Invalid(field.NewPath("patch"), fmt.Sprintf("%+v", patchMap), runtime.NewStrictDecodingError(strictErrs).Error()),
})

Check warning on line 122 in internal/resourcemodifiers/strategic_merge_patch.go

View check run for this annotation

Codecov / codecov/patch

internal/resourcemodifiers/strategic_merge_patch.go#L120-L122

Added lines #L120 - L122 were not covered by tests
}

return nil
Expand Down
3 changes: 1 addition & 2 deletions pkg/plugin/framework/common/client_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ func FromGRPCError(err error) error {
}

for _, detail := range statusErr.Details() {
switch t := detail.(type) {
case *proto.Stack:
if t, ok := detail.(*proto.Stack); ok {

Check warning on line 40 in pkg/plugin/framework/common/client_errors.go

View check run for this annotation

Codecov / codecov/patch

pkg/plugin/framework/common/client_errors.go#L40

Added line #L40 was not covered by tests
return &ProtoStackError{
error: err,
stack: t,
Expand Down

0 comments on commit 9010d9b

Please sign in to comment.