Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,18 @@ issues:
max-same-issues: 0
formatters:
enable:
- gci
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
settings:
gci:
sections:
- standard
- default
- localmodule
custom-order: true # make the section order the same as the order of "sections".
5 changes: 3 additions & 2 deletions cmd/cmdtrace/cmd_span.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import (

dockercli "github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
commands "github.com/docker/compose/v5/cmd/compose"
"github.com/docker/compose/v5/internal/tracing"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"

commands "github.com/docker/compose/v5/cmd/compose"
"github.com/docker/compose/v5/internal/tracing"
)

// Setup should be called as part of the command's PersistentPreRunE
Expand Down
3 changes: 2 additions & 1 deletion cmd/cmdtrace/cmd_span_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"reflect"
"testing"

commands "github.com/docker/compose/v5/cmd/compose"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"

commands "github.com/docker/compose/v5/cmd/compose"
)

func TestGetFlags(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"context"

"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"
)

type attachOpts struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"
cliopts "github.com/docker/cli/opts"
"github.com/docker/compose/v5/cmd/display"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/cmd/display"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type buildOptions struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (

"github.com/docker/cli/cli/command"
"github.com/docker/cli/opts"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"
)

type commitOptions struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"strings"

"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"
)

// validArgsFn defines a completion func to be returned to fetch completion options
Expand Down
9 changes: 5 additions & 4 deletions cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ import (
"github.com/docker/cli/cli-plugins/metadata"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/pkg/kvfile"
"github.com/morikuni/aec"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v5/cmd/display"
"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/internal/tracing"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/docker/compose/v5/pkg/remote"
"github.com/docker/compose/v5/pkg/utils"
"github.com/morikuni/aec"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import (
"github.com/compose-spec/compose-go/v2/template"
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/cmd/formatter"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type copyOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import (

"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type createOptions struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
"time"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/docker/compose/v5/pkg/utils"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/docker/compose/v5/pkg/utils"
)

type downOptions struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/compose/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"fmt"

"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"

"github.com/spf13/cobra"
)

type eventsOpts struct {
Expand Down
5 changes: 3 additions & 2 deletions cmd/compose/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ import (
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type execOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"context"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type exportOptions struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"os"

"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"
)

type generateOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import (

"github.com/containerd/platforms"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/go-units"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type imageOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"os"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/docker/compose/v5/pkg/utils"
)

Expand Down
5 changes: 2 additions & 3 deletions cmd/compose/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ import (
"strings"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/compose"

"github.com/docker/cli/opts"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type lsOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"errors"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type logsOptions struct {
Expand Down
1 change: 1 addition & 0 deletions cmd/compose/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/compose-spec/compose-go/v2/template"
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"

"github.com/docker/compose/v5/cmd/display"
"github.com/docker/compose/v5/cmd/prompt"
"github.com/docker/compose/v5/internal/tracing"
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ import (

"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/streams"
"github.com/docker/compose/v5/pkg/mocks"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"

"github.com/docker/compose/v5/pkg/mocks"
)

func TestApplyPlatforms_InferFromRuntime(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"context"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type pauseOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"strings"

"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type portOptions struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/compose/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (
"sort"
"strings"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"

"github.com/docker/cli/cli/command"
cliformatter "github.com/docker/cli/cli/command/formatter"
cliflags "github.com/docker/cli/cli/flags"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/cmd/formatter"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type psOptions struct {
Expand Down
5 changes: 3 additions & 2 deletions cmd/compose/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import (

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type publishOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import (
"github.com/compose-spec/compose-go/v2/cli"
"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/morikuni/aec"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type pullOptions struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

"github.com/compose-spec/compose-go/v2/types"
"github.com/docker/cli/cli/command"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
)

type pushOptions struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/compose/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"fmt"

"github.com/docker/cli/cli/command"
"github.com/spf13/cobra"

"github.com/docker/compose/v5/pkg/api"
"github.com/docker/compose/v5/pkg/compose"
"github.com/spf13/cobra"
)

type removeOptions struct {
Expand Down
Loading