Skip to content

Commit

Permalink
Enable gci
Browse files Browse the repository at this point in the history
  • Loading branch information
shuheiktgw committed Feb 12, 2025
1 parent 77f9bba commit a669d30
Show file tree
Hide file tree
Showing 134 changed files with 396 additions and 419 deletions.
9 changes: 6 additions & 3 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@

[linters-settings.gci]
sections = [
"prefix(github.com/DataDog/datadog-operator)"
"standard",
"default",
"prefix(github.com/DataDog/datadog-operator)",
"blank",
"dot",
]

[linters-settings.godot]
Expand Down Expand Up @@ -55,7 +59,6 @@
"paralleltest",
"nestif",
"exhaustive",
"gci",
"wsl",
"godox",
"godot",
Expand Down Expand Up @@ -105,4 +108,4 @@
".cache",
"go/pkg/mod",
"pkg/mod",
]
]
3 changes: 2 additions & 1 deletion cmd/check-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (

"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/DataDog/datadog-operator/cmd/check-operator/root"

_ "k8s.io/client-go/plugin/pkg/client/auth"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/check-operator/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (

"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// Options provides information required to manage canary.
Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ package main
import (
"os"

"github.com/DataDog/datadog-operator/cmd/helpers/secrets"

"github.com/spf13/cobra"

"github.com/DataDog/datadog-operator/cmd/helpers/secrets"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/helpers/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"path/filepath"
"strings"

s "github.com/DataDog/datadog-operator/pkg/secrets"

"github.com/spf13/cobra"

s "github.com/DataDog/datadog-operator/pkg/secrets"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubectl-datadog/agent/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
package agent

import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/agent/check"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/agent/find"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/agent/upgrade"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)

// options provides information required by agent command
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-datadog/agent/check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"fmt"
"sync"

"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/cli-runtime/pkg/genericclioptions"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/remotecommand"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-datadog/agent/find/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"errors"
"fmt"

"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var findExample = `
Expand Down
10 changes: 5 additions & 5 deletions cmd/kubectl-datadog/agent/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"errors"
"fmt"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
apiutils "github.com/DataDog/datadog-operator/api/utils"
"github.com/DataDog/datadog-operator/pkg/defaulting"
"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
apiutils "github.com/DataDog/datadog-operator/api/utils"
"github.com/DataDog/datadog-operator/pkg/defaulting"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubectl-datadog/clusteragent/clusteragent/clusteragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
package clusteragent

import (
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/clusteragent/leader"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/clusteragent/upgrade"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/clusteragent/leader"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/clusteragent/upgrade"
)

// options provides information required by clusteragent command
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-datadog/clusteragent/leader/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/spf13/cobra"
coordv1 "k8s.io/api/coordination/v1"
corev1 "k8s.io/api/core/v1"
Expand All @@ -20,6 +18,8 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/discovery"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var leaderExample = `
Expand Down
10 changes: 5 additions & 5 deletions cmd/kubectl-datadog/clusteragent/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
"errors"
"fmt"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
apiutils "github.com/DataDog/datadog-operator/api/utils"
"github.com/DataDog/datadog-operator/pkg/defaulting"
"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
apiutils "github.com/DataDog/datadog-operator/api/utils"
"github.com/DataDog/datadog-operator/pkg/defaulting"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubectl-datadog/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
package datadog

import (
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/agent/agent"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/clusteragent/clusteragent"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/flare"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/get"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/metrics"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/validate"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)

// options provides information required by datadog command
Expand Down
8 changes: 4 additions & 4 deletions cmd/kubectl-datadog/flare/flare.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ import (
"strings"
"time"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
"github.com/DataDog/datadog-operator/pkg/version"

"github.com/mholt/archiver/v3"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
Expand All @@ -36,6 +32,10 @@ import (
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/tools/remotecommand"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
"github.com/DataDog/datadog-operator/pkg/version"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubectl-datadog/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"fmt"
"io"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"

"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v2alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var getExample = `
Expand Down
5 changes: 3 additions & 2 deletions cmd/kubectl-datadog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ package main
import (
"os"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/datadog"

"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/datadog"

_ "k8s.io/client-go/plugin/pkg/client/auth"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/kubectl-datadog/metrics/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (
"io"
"time"

"github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
"k8s.io/apimachinery/pkg/util/duration"

"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/duration"
"k8s.io/cli-runtime/pkg/genericclioptions"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1"
"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var getExample = `
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-datadog/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package metrics

import (
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/metrics/get"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/metrics/get"
)

// options provides information required by agent command
Expand Down
6 changes: 3 additions & 3 deletions cmd/kubectl-datadog/validate/ad/ad/ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
package ad

import (
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/pod"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/service"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/pod"
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/service"
)

// options provides information required by ad command.
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubectl-datadog/validate/ad/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (
"errors"
"fmt"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var podExample = `
Expand Down
3 changes: 2 additions & 1 deletion cmd/kubectl-datadog/validate/ad/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (
"errors"
"fmt"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
"github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/pkg/plugin/common"
)

var serviceExample = `
Expand Down
4 changes: 2 additions & 2 deletions cmd/kubectl-datadog/validate/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
package validate

import (
"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/ad"

"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/DataDog/datadog-operator/cmd/kubectl-datadog/validate/ad/ad"
)

// options provides information required by validate command
Expand Down
Loading

0 comments on commit a669d30

Please sign in to comment.