-
Notifications
You must be signed in to change notification settings - Fork 703
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. nit: add default:
// NOP Same for other occurrences too |
||
} | ||
|
||
var dockerComposeYAML = fmt.Sprintf(` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,9 +96,7 @@ linters: | |
- "fmt.Fprintln" | ||
- "fmt.Fprintf" | ||
- name: redundant-test-main-exit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be removed |
||
disabled: true | ||
- name: enforce-switch-style | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line can be removed |
||
disabled: true | ||
- name: var-naming | ||
disabled: true | ||
depguard: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,6 @@ import ( | |
) | ||
|
||
func TestMain(m *testing.M) { | ||
// Prep exit code | ||
exitCode := 0 | ||
defer func() { os.Exit(exitCode) }() | ||
|
||
var ( | ||
snapFile *os.File | ||
before, after []byte | ||
|
@@ -39,11 +35,7 @@ func TestMain(m *testing.M) { | |
before, _ = highk.SnapshotOpenFiles(snapFile) | ||
} | ||
|
||
exitCode = m.Run() | ||
|
||
if exitCode != 0 { | ||
return | ||
} | ||
m.Run() | ||
|
||
if os.Getenv("HIGHK_EXPERIMENTAL_FD") != "" { | ||
after, _ = highk.SnapshotOpenFiles(snapFile) | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This is irrelevant to |
||
} | ||
} | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This is irrelevant to |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,6 @@ import ( | |
) | ||
|
||
func TestMain(m *testing.M) { | ||
// Prep exit code | ||
exitCode := 0 | ||
defer func() { os.Exit(exitCode) }() | ||
|
||
var ( | ||
snapFile *os.File | ||
before, after []byte | ||
|
@@ -39,11 +35,7 @@ func TestMain(m *testing.M) { | |
before, _ = highk.SnapshotOpenFiles(snapFile) | ||
} | ||
|
||
exitCode = m.Run() | ||
|
||
if exitCode != 0 { | ||
return | ||
} | ||
m.Run() | ||
|
||
if os.Getenv("HIGHK_EXPERIMENTAL_FD") != "" { | ||
after, _ = highk.SnapshotOpenFiles(snapFile) | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. This is irrelevant to |
||
} | ||
} | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This is irrelevant to |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ LINE: | |
skip = true | ||
case MarkerEnd: | ||
sawMarkerEnd = true | ||
default: | ||
} | ||
} | ||
if !skip { | ||
|
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