Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ run:
concurrency: 2
linters:
default: none
disable:
# gocognit deliberately replaced gocyclo — do not re-enable. Cyclomatic
# complexity charges a flat guard clause the same as a nested branch, so
# our fail-fast style accumulated //nolint suppressions on functions that
# are long but flat. Cognitive complexity penalizes nesting and barely
# charges early returns, keeping the signal on genuinely tangled code.
- gocyclo
enable:
- copyloopvar
- depguard
- errcheck
- errorlint
- forbidigo
- gocognit
- gocritic
- gocyclo
- gomodguard
- govet
- ineffassign
Expand Down Expand Up @@ -63,8 +70,8 @@ linters:
- diagnostic
- opinionated
- style
gocyclo:
min-complexity: 16
gocognit:
min-complexity: 30
gomodguard:
blocked:
modules:
Expand Down
5 changes: 4 additions & 1 deletion cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ func (o *BackendOptions) Add(option compose.Option) {
}

// RootCommand returns the compose command with its child commands
func RootCommand(dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command { //nolint:gocyclo
// FIXME(ndeloof) complete migration to gocognit
//
//nolint:gocognit
func RootCommand(dockerCli command.Cli, backendOptions *BackendOptions) *cobra.Command {
opts := ProjectOptions{}
var (
ansi string
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func psCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backend
return psCmd
}

func runPs(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, services []string, opts psOptions) error { //nolint:gocyclo
func runPs(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, services []string, opts psOptions) error {
project, name, err := opts.projectOrName(ctx, dockerCli, services...)
if err != nil {
return err
Expand Down
2 changes: 0 additions & 2 deletions cmd/compose/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func upCommand(p *ProjectOptions, dockerCli command.Cli, backendOptions *Backend
return upCmd
}

//nolint:gocyclo
func validateFlags(up *upOptions, create *createOptions) error {
if up.waitTimeout < 0 {
return fmt.Errorf("--wait-timeout must be a non-negative integer")
Expand Down Expand Up @@ -228,7 +227,6 @@ func validateFlags(up *upOptions, create *createOptions) error {
return nil
}

//nolint:gocyclo
func runUp(
ctx context.Context,
dockerCli command.Cli,
Expand Down
3 changes: 3 additions & 0 deletions pkg/bridge/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ func convert(ctx context.Context, dockerCli command.Cli, model map[string]any, o
}

// LoadAdditionalResources loads additional resources from the project, such as image references, secrets, configs and exposed ports
// FIXME(ndeloof) complete migration to gocognit
//
//nolint:gocognit
func LoadAdditionalResources(ctx context.Context, dockerCLI command.Cli, project *types.Project) (*types.Project, error) {
for name, service := range project.Services {
imageName := api.GetImageNameOrDefault(service, project.Name)
Expand Down
Loading
Loading