Skip to content

Commit

Permalink
Format go imports (flyteplugins)
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 75fd425
Show file tree
Hide file tree
Showing 177 changed files with 656 additions and 969 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fi
docker build -t "$IMAGE_TAG_WITH_SHA" --target=${BUILD_PHASE} .
echo "${IMAGE_TAG_WITH_SHA} built locally."

# if REGISTRY specified, push the images to the remote registry
# if REGISTRY specified, push the images to the remote registy

Check failure on line 46 in flyteplugins/boilerplate/flyte/docker_build/docker_build.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

registy ==> registry
if [ -n "$REGISTRY" ]; then

if [ -n "${DOCKER_REGISTRY_PASSWORD}" ]; then
Expand Down
3 changes: 2 additions & 1 deletion flyteplugins/boilerplate/flyte/golang_support_tools/tools.go
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 @@ -9,7 +9,7 @@ go generate ./...
if [ -n "$DELTA_CHECK" ]; then
DIRTY=$(git status --porcelain)
if [ -n "$DIRTY" ]; then
echo "FAILED: Go code updated without committing generated code."
echo "FAILED: Go code updated without commiting generated code."

Check failure on line 12 in flyteplugins/boilerplate/flyte/golang_test_targets/go-gen.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

commiting ==> committing
echo "Ensure make generate has run and all changes are committed."
DIFF=$(git diff)
echo "diff detected: $DIFF"
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 .
8 changes: 3 additions & 5 deletions flyteplugins/go/tasks/aws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
package aws

import (
"context"
"fmt"
"os"

"github.com/flyteorg/flyte/flytestdlib/errors"

"context"

"sync"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"

"github.com/flyteorg/flyte/flytestdlib/errors"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

Expand Down
2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
awsConfig "github.com/aws/aws-sdk-go-v2/config"
"github.com/flyteorg/flyte/flytestdlib/config"

pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config"
"github.com/flyteorg/flyte/flytestdlib/config"
)

//go:generate pflags Config --default-var defaultConfig
Expand Down
4 changes: 2 additions & 2 deletions flyteplugins/go/tasks/logs/logging_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog"
v1 "k8s.io/api/core/v1"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog"
"github.com/flyteorg/flyte/flytestdlib/logger"
v1 "k8s.io/api/core/v1"
)

type logPlugin struct {
Expand Down
8 changes: 4 additions & 4 deletions flyteplugins/go/tasks/logs/logging_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"testing"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog"
"github.com/go-test/deep"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/stretchr/testify/assert"
v1 "k8s.io/api/core/v1"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/tasklog"
)

const podName = "PodName"
Expand Down
2 changes: 0 additions & 2 deletions flyteplugins/go/tasks/pluginmachinery/bundle/fail_fast.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"time"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/errors"

pluginMachinery "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import (
"context"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/stretchr/testify/assert"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
)

var testHandler = failFastHandler{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package catalog
import (
"context"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/flyteorg/flyte/flytestdlib/bitarray"

"github.com/flyteorg/flyte/flytestdlib/errors"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
)

type ResponseStatus uint8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"reflect"
"testing"

"github.com/stretchr/testify/mock"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue/mocks"
"github.com/flyteorg/flyte/flytestdlib/bitarray"
"github.com/stretchr/testify/mock"
)

var exampleInterface = &core.TypedInterface{
Expand Down
1 change: 0 additions & 1 deletion flyteplugins/go/tasks/pluginmachinery/catalog/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"testing"

"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/stretchr/testify/assert"
)

func TestHashLiteralMap_LiteralsWithHashSet(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import (
"reflect"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/errors"

"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

type ReaderWorkItem struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"reflect"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/logger"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/errors"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/workqueue"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

type WriterWorkItem struct {
Expand Down
3 changes: 2 additions & 1 deletion flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package core

import (
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
v1 "k8s.io/api/core/v1"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)

// TaskOverrides interface to expose any overrides that have been set for this task (like resource overrides etc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ import (
"reflect"
"sync"

"sigs.k8s.io/controller-runtime/pkg/cache"

"k8s.io/apimachinery/pkg/api/meta"

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
)

Expand Down
3 changes: 2 additions & 1 deletion flyteplugins/go/tasks/pluginmachinery/core/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"testing"

"gotest.tools/assert"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
"gotest.tools/assert"
)

func TestLoadPlugin(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion flyteplugins/go/tasks/pluginmachinery/core/setup_context.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package core

import (
"github.com/flyteorg/flyte/flytestdlib/promutils"
"k8s.io/apimachinery/pkg/types"

"github.com/flyteorg/flyte/flytestdlib/promutils"
)

// When a change is observed, the owning entity with id types.NamespacedName can be triggered for re-validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ import (
"regexp"
"strings"

"github.com/golang/protobuf/ptypes"
"github.com/pkg/errors"

idlCore "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/golang/protobuf/ptypes"
"github.com/pkg/errors"
)

var alphaNumericOnly = regexp.MustCompile("[^a-zA-Z0-9_]+")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"testing"
"time"

pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
"github.com/stretchr/testify/assert"

"github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
pluginsCoreMocks "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
"github.com/flyteorg/flyte/flytestdlib/storage"

"github.com/stretchr/testify/assert"
)

type dummyInputReader struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ package config
import (
"time"

"k8s.io/apimachinery/pkg/api/resource"

config2 "github.com/flyteorg/flyte/flytestdlib/config"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/config"
config2 "github.com/flyteorg/flyte/flytestdlib/config"
)

//go:generate pflags K8sPluginConfig --default-var=defaultK8sConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ package flytek8s
import (
"context"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/validation"

"github.com/flyteorg/flyte/flyteplugins/go/tasks/errors"
pluginscore "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config"

"github.com/flyteorg/flyte/flytestdlib/logger"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/validation"
)

const resourceGPU = "gpu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ import (
"context"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/validation"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/mocks"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core/template"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config"
mocks2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io/mocks"
"github.com/flyteorg/flyte/flytestdlib/storage"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/validation"
)

var zeroQuantity = resource.MustParse("0")
Expand Down
6 changes: 3 additions & 3 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/copilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import (
"fmt"
"time"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/storage"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
core2 "github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/flytek8s/config"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/pluginmachinery/io"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/storage"
)

const (
Expand Down
Loading

0 comments on commit 75fd425

Please sign in to comment.