-
Notifications
You must be signed in to change notification settings - Fork 699
Enable linters for enforce-switch-style
& redundant-test-main-exit
#4496
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
base: main
Are you sure you want to change the base?
Enable linters for enforce-switch-style
& redundant-test-main-exit
#4496
Conversation
Signed-off-by: Aditya <[email protected]>
Signed-off-by: Aditya <[email protected]>
@@ -55,15 +47,11 @@ func TestMain(m *testing.M) { | |||
for _, file := range diff { | |||
fmt.Fprintln(os.Stderr, file) | |||
} | |||
|
|||
exitCode = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is irrelevant to redundant-test-main-exit
} | ||
} | ||
|
||
if err := highk.FindGoRoutines(); err != nil { | ||
fmt.Fprintln(os.Stderr, "Leaking go routines") | ||
fmt.Fprintln(os.Stderr, os.Stderr, err.Error()) | ||
|
||
exitCode = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is irrelevant to redundant-test-main-exit
@@ -55,15 +47,11 @@ func TestMain(m *testing.M) { | |||
for _, file := range diff { | |||
fmt.Fprintln(os.Stderr, file) | |||
} | |||
|
|||
exitCode = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is irrelevant to redundant-test-main-exit
} | ||
} | ||
|
||
if err := highk.FindGoRoutines(); err != nil { | ||
fmt.Fprintln(os.Stderr, "Leaking go routines") | ||
fmt.Fprintln(os.Stderr, err.Error()) | ||
|
||
exitCode = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is irrelevant to redundant-test-main-exit
@@ -96,7 +96,6 @@ linters: | |||
- "fmt.Fprintln" | |||
- "fmt.Fprintf" | |||
- name: redundant-test-main-exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
@@ -185,9 +185,6 @@ linters: | |||
# 2605 occurrences. Kind of useful in itself, but unacceptable amount of effort to fix | |||
disabled: true | |||
- name: enforce-switch-style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
@@ -28,6 +28,7 @@ func TestComposePauseAndUnpause(t *testing.T) { | |||
switch base.Info().CgroupDriver { | |||
case "none", "": | |||
t.Skip("requires cgroup (for pausing)") | |||
default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add // NOP
to clarify that this empty default
is not a typo
default:
// NOP
Same for other occurrences too
@@ -97,7 +97,6 @@ linters: | |||
- "fmt.Fprintf" | |||
- name: redundant-test-main-exit | |||
- name: enforce-switch-style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
Resolves #4493, in parts.
redundant-test-main-exit
&enforce-switch-style
in golangci file.default
case otherwise.