Skip to content

Commit c312883

Browse files
committed
fix linting issues
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 9de7e2a commit c312883

File tree

13 files changed

+12
-14
lines changed

13 files changed

+12
-14
lines changed

cmd/compose/compose.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ func (o *ProjectOptions) toProjectOptions(po ...cli.ProjectOptionsFn) (*cli.Proj
387387
// if none was selected, get default compose.yaml file from current dir or parent folder
388388
cli.WithDefaultConfigPath,
389389
// .. and then, a project directory != PWD maybe has been set so let's load .env file
390-
cli.WithEnvFiles(o.EnvFiles...),
391-
cli.WithDotEnv,
390+
cli.WithEnvFiles(o.EnvFiles...), //nolint:gocritic // intentionally applying cli.WithEnvFiles twice.
391+
cli.WithDotEnv, //nolint:gocritic // intentionally applying cli.WithDotEnv twice.
392392
// eventually COMPOSE_PROFILES should have been set
393393
cli.WithDefaultProfiles(o.Profiles...),
394394
cli.WithName(o.ProjectName),

cmd/formatter/consts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
// TemplateLegacyJSON the legacy json formatting value using go template
2323
TemplateLegacyJSON = "{{json.}}"
2424
// PRETTY is the constant for default formats on list commands
25+
//
2526
// Deprecated: use TABLE
2627
PRETTY = "pretty"
2728
// TABLE Print output in table format with column headers (default)

cmd/formatter/formatter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestPrint(t *testing.T) {
4545
}
4646

4747
b := &bytes.Buffer{}
48-
assert.NilError(t, Print(testList, PRETTY, b, func(w io.Writer) {
48+
assert.NilError(t, Print(testList, TABLE, b, func(w io.Writer) {
4949
for _, t := range testList {
5050
_, _ = fmt.Fprintf(w, "%s\t%s\n", t.Name, t.Status)
5151
}

pkg/compose/loader.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,18 @@ func (s *composeService) buildProjectOptions(options api.ProjectLoadOptions, rem
9595
}
9696

9797
opts = append(opts,
98+
// Load PWD/.env if present and no explicit --env-file has been set
9899
cli.WithEnvFiles(options.EnvFiles...),
100+
// read dot env file to populate project environment
99101
cli.WithDotEnv,
102+
// get compose file path set by COMPOSE_FILE
100103
cli.WithConfigFileEnv,
104+
// if none was selected, get default compose.yaml file from current dir or parent folder
101105
cli.WithDefaultConfigPath,
102-
cli.WithEnvFiles(options.EnvFiles...),
103-
cli.WithDotEnv,
106+
// .. and then, a project directory != PWD maybe has been set so let's load .env file
107+
cli.WithEnvFiles(options.EnvFiles...), //nolint:gocritic // intentionally applying cli.WithEnvFiles twice.
108+
cli.WithDotEnv, //nolint:gocritic // intentionally applying cli.WithDotEnv twice.
109+
// eventually COMPOSE_PROFILES should have been set
104110
cli.WithDefaultProfiles(options.Profiles...),
105111
cli.WithName(options.ProjectName),
106112
)

pkg/e2e/cancel_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
/*
54
Copyright 2020 Docker Compose CLI authors

pkg/e2e/cascade_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
/*
54
Copyright 2022 Docker Compose CLI authors

pkg/e2e/container_name_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
/*
54
Copyright 2022 Docker Compose CLI authors

pkg/e2e/noDeps_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
/*
54
Copyright 2022 Docker Compose CLI authors

pkg/e2e/up_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build !windows
2-
// +build !windows
32

43
/*
54
Copyright 2022 Docker Compose CLI authors

pkg/watch/watcher_darwin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build darwin
2-
// +build darwin
32

43
/*
54
Copyright 2020 Docker Compose CLI authors

0 commit comments

Comments
 (0)