mirror of
https://github.com/docker/compose.git
synced 2026-08-31 14:52:42 +00:00
fix various linting issues
Got these when running locally on a more recent version of golangci-lint:
pkg/compose/build_bake.go:187:3: importShadow: shadow of imported from 'github.com/docker/cli/cli/command/image/build' package 'build' (gocritic)
build := *service.Build
^
pkg/compose/build_bake.go:526:19: importShadow: shadow of imported from 'github.com/docker/cli/cli/command/image/build' package 'build' (gocritic)
func toBakeAttest(build types.BuildConfig) []string {
^
pkg/compose/create.go:1453:2: importShadow: shadow of imported from 'github.com/docker/docker/api/types/network' package 'network' (gocritic)
network string,
^
pkg/compose/create.go:1468:2: importShadow: shadow of imported from 'github.com/docker/docker/api/types/network' package 'network' (gocritic)
network string,
^
pkg/compose/monitor.go:42:17: importShadow: shadow of imported from 'github.com/docker/compose/v2/pkg/api' package 'api' (gocritic)
func newMonitor(api client.APIClient, project string) *monitor {
^
cmd/compose/config.go:337:1: File is not properly formatted (gofumpt)
return
^
pkg/compose/convergence.go:608:1: File is not properly formatted (gofumpt)
return
^
pkg/compose/cp.go:335:1: File is not properly formatted (gofumpt)
return
^
pkg/e2e/compose_up_test.go:35:10: go-require: c.RunDockerComposeCmd contains assertions that must only be used in the goroutine running the test function (testifylint)
res := c.RunDockerComposeCmd(t, "-f", "fixtures/dependencies/deps-completed-successfully.yaml", "--project-name", projectName, "up", "--wait", "-d")
^
pkg/e2e/healthcheck_test.go:42:10: go-require: c.RunDockerComposeCmd contains assertions that must only be used in the goroutine running the test function (testifylint)
res := c.RunDockerComposeCmd(t, "-f", "fixtures/start_interval/compose.yaml", "--project-name", projectName, "up", "--wait", "-d", "test")
^
10 issues:
* gocritic: 5
* gofumpt: 3
* testifylint: 2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6719f47bd4
commit
74a4ccdd85
8 changed files with 51 additions and 50 deletions
|
|
@ -32,6 +32,7 @@ func TestUpWait(t *testing.T) {
|
|||
timeout := time.After(30 * time.Second)
|
||||
done := make(chan bool)
|
||||
go func() {
|
||||
//nolint:nolintlint,testifylint // helper asserts inside goroutine; acceptable in this e2e test
|
||||
res := c.RunDockerComposeCmd(t, "-f", "fixtures/dependencies/deps-completed-successfully.yaml", "--project-name", projectName, "up", "--wait", "-d")
|
||||
assert.Assert(t, strings.Contains(res.Combined(), "e2e-deps-wait-oneshot-1"), res.Combined())
|
||||
done <- true
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ func TestStartInterval(t *testing.T) {
|
|||
timeout := time.After(30 * time.Second)
|
||||
done := make(chan bool)
|
||||
go func() {
|
||||
//nolint:nolintlint,testifylint // helper asserts inside goroutine; acceptable in this e2e test
|
||||
res := c.RunDockerComposeCmd(t, "-f", "fixtures/start_interval/compose.yaml", "--project-name", projectName, "up", "--wait", "-d", "test")
|
||||
out := res.Combined()
|
||||
assert.Assert(t, strings.Contains(out, "Healthy"), out)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue