Merge pull request #8673 from mmorel-35/revive/unnecessary-stmt
Some checks failed
Run the E2E test on kind / build (push) Failing after 5m33s
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 36s

chore: enable unnecessary-stmt from revive
This commit is contained in:
Tiger Kaovilai
2025-02-11 02:50:29 +07:00
committed by GitHub
3 changed files with 4 additions and 11 deletions

View File

@@ -272,7 +272,6 @@ linters-settings:
- name: unexported-return
disabled: true
- name: unnecessary-stmt
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true

View File

@@ -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()),
})
}
return nil

View File

@@ -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 {
return &ProtoStackError{
error: err,
stack: t,