Skip to content

Commit

Permalink
Format go imports (flytepropeller)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <[email protected]>
  • Loading branch information
andrewwdye committed Oct 13, 2023
1 parent c6476cc commit d078817
Show file tree
Hide file tree
Showing 226 changed files with 685 additions and 825 deletions.
10 changes: 10 additions & 0 deletions flytepropeller/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ linters:
- deadcode
- errcheck
- gas
- gci
- goconst
- goimports
- golint
Expand All @@ -28,3 +29,12 @@ linters:
- unparam
- unused
- varcheck

linters-settings:
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/flyteorg)
skip-generated: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ package tools
import (
_ "github.com/EngHabu/mockery/cmd/mockery"
_ "github.com/alvaroloes/enumer"
_ "github.com/flyteorg/flyte/flytestdlib/cli/pflags"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"

_ "github.com/flyteorg/flyte/flytestdlib/cli/pflags"
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ tools=(
"github.com/EngHabu/mockery/cmd/mockery"
"github.com/flyteorg/flytestdlib/cli/pflags@latest"
"github.com/golangci/golangci-lint/cmd/golangci-lint"
"github.com/daixiang0/gci"
"github.com/alvaroloes/enumer"
"github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*")
gci write -s standard -s default -s "prefix(github.com/flyteorg)" --custom-order --skip-generated .
10 changes: 10 additions & 0 deletions flytepropeller/boilerplate/flyte/golangci_file/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ linters:
- deadcode
- errcheck
- gas
- gci
- goconst
- goimports
- golint
Expand All @@ -28,3 +29,12 @@ linters:
- unparam
- unused
- varcheck

linters-settings:
gci:
custom-order: true
sections:
- standard
- default
- prefix(github.com/flyteorg)
skip-generated: true
8 changes: 3 additions & 5 deletions flytepropeller/cmd/controller/cmd/init_certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ package cmd
import (
"context"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"

webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config"
"github.com/spf13/cobra"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyte/flytepropeller/pkg/webhook"

"github.com/spf13/cobra"
webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config"
)

// initCertsCmd initializes x509 TLS Certificates and saves them to a secret.
Expand Down
27 changes: 11 additions & 16 deletions flytepropeller/cmd/controller/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ import (
"os"
"runtime"

"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/sync/errgroup"
"k8s.io/client-go/rest"
"k8s.io/klog"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller"
config2 "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors"
"github.com/flyteorg/flyte/flytepropeller/pkg/signals"

"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
Expand All @@ -21,21 +31,6 @@ import (
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/flytestdlib/version"

"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

"golang.org/x/sync/errgroup"

"k8s.io/client-go/rest"
"k8s.io/klog"

"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics"
)

const (
Expand Down
18 changes: 7 additions & 11 deletions flytepropeller/cmd/controller/cmd/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@ package cmd
import (
"context"

"github.com/spf13/cobra"
"golang.org/x/sync/errgroup"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/executors"
"github.com/flyteorg/flyte/flytepropeller/pkg/signals"
"github.com/flyteorg/flyte/flytepropeller/pkg/webhook"
webhookConfig "github.com/flyteorg/flyte/flytepropeller/pkg/webhook/config"

"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/profutils"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"

"github.com/spf13/cobra"

"golang.org/x/sync/errgroup"

"k8s.io/client-go/rest"

"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
)

var webhookCmd = &cobra.Command{
Expand Down
3 changes: 1 addition & 2 deletions flytepropeller/cmd/controller/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package main

import (
_ "github.com/flyteorg/flyte/flytepropeller/plugins"

"github.com/flyteorg/flyte/flytepropeller/cmd/controller/cmd"
_ "github.com/flyteorg/flyte/flytepropeller/plugins"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions flytepropeller/cmd/kubectl-flyte/cmd/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"io/ioutil"
"os"

"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common"
compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

type CompileOpts struct {
Expand Down
8 changes: 3 additions & 5 deletions flytepropeller/cmd/kubectl-flyte/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,19 @@ import (
"fmt"
"io/ioutil"

v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/ghodss/yaml"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common"
compilerErrors "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s"

"github.com/pkg/errors"
"github.com/spf13/cobra"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions flytepropeller/cmd/kubectl-flyte/cmd/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"testing"

"github.com/ghodss/yaml"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common"
"github.com/flyteorg/flyte/flytepropeller/pkg/compiler/transformers/k8s"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
)

var update = flag.Bool("update", false, "Update .golden files")
Expand Down
3 changes: 2 additions & 1 deletion flytepropeller/cmd/kubectl-flyte/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"fmt"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/flyteorg/flyte/flytepropeller/pkg/controller"
)

type DeleteOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/cmd/kubectl-flyte/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import (
"strings"

gotree "github.com/DiSiqueira/GoTree"
"github.com/flyteorg/flyte/flytestdlib/storage"
"github.com/spf13/cobra"
v12 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd/printers"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytestdlib/storage"
)

type GetOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/cmd/kubectl-flyte/cmd/printers/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

gotree "github.com/DiSiqueira/GoTree"
"github.com/fatih/color"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/encoding"
"github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
"github.com/flyteorg/flyte/flytepropeller/pkg/controller/nodes/task"
)
Expand Down
8 changes: 4 additions & 4 deletions flytepropeller/cmd/kubectl-flyte/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import (
"runtime"
"time"

"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/version"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

flyteclient "github.com/flyteorg/flyte/flytepropeller/pkg/client/clientset/versioned"
"github.com/spf13/cobra"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/version"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion flytepropeller/cmd/kubectl-flyte/cmd/visualize.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"fmt"

"github.com/flyteorg/flyte/flytepropeller/pkg/visualize"
"github.com/spf13/cobra"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/flyteorg/flyte/flytepropeller/pkg/visualize"
)

type VisualizeOpts struct {
Expand Down
3 changes: 2 additions & 1 deletion flytepropeller/cmd/kubectl-flyte/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"fmt"
"os"

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

"github.com/flyteorg/flyte/flytepropeller/cmd/kubectl-flyte/cmd"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

func init() {
Expand Down
22 changes: 10 additions & 12 deletions flytepropeller/cmd/manager/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ import (
"os"
"runtime"

"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/profutils"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/version"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"

"github.com/flyteorg/flyte/flytepropeller/manager"
managerConfig "github.com/flyteorg/flyte/flytepropeller/manager/config"
propellerConfig "github.com/flyteorg/flyte/flytepropeller/pkg/controller/config"
"github.com/flyteorg/flyte/flytepropeller/pkg/signals"
"github.com/flyteorg/flyte/flytepropeller/pkg/utils"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/profutils"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/version"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions flytepropeller/events/admin_eventsink.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"context"
"fmt"

admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin"
"github.com/golang/protobuf/proto"
"golang.org/x/time/rate"

admin2 "github.com/flyteorg/flyte/flyteidl/clients/go/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/service"
"github.com/flyteorg/flyte/flytepropeller/events/errors"
"github.com/flyteorg/flyte/flytestdlib/fastcheck"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/golang/protobuf/proto"
"golang.org/x/time/rate"
)

type adminEventSink struct {
Expand Down
2 changes: 1 addition & 1 deletion flytepropeller/events/admin_eventsink_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"testing"
"time"

"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteidl/clients/go/admin"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/event"
"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/golang/protobuf/ptypes"
)

var (
Expand Down
Loading

0 comments on commit d078817

Please sign in to comment.