Skip to content

Commit 89d3944

Browse files
thaJeztahndeloof
authored andcommitted
fix linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent f2b14fe commit 89d3944

13 files changed

Lines changed: 14 additions & 16 deletions

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: 6 additions & 0 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,
106+
// .. and then, a project directory != PWD maybe has been set so let's load .env file
102107
cli.WithEnvFiles(options.EnvFiles...),
103108
cli.WithDotEnv,
109+
// eventually COMPOSE_PROFILES should have been set
104110
cli.WithDefaultProfiles(options.Profiles...),
105111
cli.WithName(options.ProjectName),
106112
)

pkg/compose/model.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ func (s *composeService) ensureModels(ctx context.Context, project *types.Projec
3939
return nil
4040
}
4141

42-
api, err := s.newModelAPI(project)
42+
mdlAPI, err := s.newModelAPI(project)
4343
if err != nil {
4444
return err
4545
}
46-
defer api.Close()
47-
availableModels, err := api.ListModels(ctx)
46+
defer mdlAPI.Close()
47+
availableModels, err := mdlAPI.ListModels(ctx)
4848

4949
eg, ctx := errgroup.WithContext(ctx)
5050
eg.Go(func() error {
51-
return api.SetModelVariables(ctx, project)
51+
return mdlAPI.SetModelVariables(ctx, project)
5252
})
5353

5454
for name, config := range project.Models {
@@ -57,12 +57,12 @@ func (s *composeService) ensureModels(ctx context.Context, project *types.Projec
5757
}
5858
eg.Go(func() error {
5959
if !slices.Contains(availableModels, config.Model) {
60-
err = api.PullModel(ctx, config, quietPull, s.events)
60+
err = mdlAPI.PullModel(ctx, config, quietPull, s.events)
6161
if err != nil {
6262
return err
6363
}
6464
}
65-
return api.ConfigureModel(ctx, config, s.events)
65+
return mdlAPI.ConfigureModel(ctx, config, s.events)
6666
})
6767
}
6868
return eg.Wait()

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)