Skip to content

Commit

Permalink
Format go imports (datacatalog) (#4230)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <andrewwdye@gmail.com>
  • Loading branch information
andrewwdye authored Oct 16, 2023
1 parent 5f41998 commit fa274e1
Show file tree
Hide file tree
Showing 58 changed files with 165 additions and 151 deletions.
10 changes: 10 additions & 0 deletions datacatalog/.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
3 changes: 2 additions & 1 deletion datacatalog/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 @@ -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 datacatalog/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
4 changes: 2 additions & 2 deletions datacatalog/cmd/entrypoints/migrate.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package entrypoints

import (
"github.com/flyteorg/flyte/datacatalog/pkg/repositories"

"context"

"github.com/spf13/cobra"

"github.com/flyteorg/flyte/datacatalog/pkg/repositories"
)

var parentMigrateCmd = &cobra.Command{
Expand Down
6 changes: 3 additions & 3 deletions datacatalog/cmd/entrypoints/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"fmt"
"os"

"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/spf13/cobra"
"github.com/spf13/pflag"

"github.com/flyteorg/flyte/flytestdlib/config"
"github.com/flyteorg/flyte/flytestdlib/config/viper"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/flyteorg/flyte/flytestdlib/logger"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions datacatalog/cmd/entrypoints/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package entrypoints
import (
"context"

"github.com/spf13/cobra"

"github.com/flyteorg/flyte/datacatalog/pkg/config"
"github.com/flyteorg/flyte/datacatalog/pkg/rpc/datacatalogservice"
"github.com/flyteorg/flyte/datacatalog/pkg/runtime"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/profutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"

"github.com/spf13/cobra"
)

var serveCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion datacatalog/cmd/entrypoints/serve_dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package entrypoints
import (
"context"

"github.com/spf13/cobra"

"github.com/flyteorg/flyte/datacatalog/pkg/config"
"github.com/flyteorg/flyte/datacatalog/pkg/rpc/datacatalogservice"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/spf13/cobra"
)

var serveDummyCmd = &cobra.Command{
Expand Down
3 changes: 2 additions & 1 deletion datacatalog/cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
"github.com/flyteorg/flyte/datacatalog/cmd/entrypoints"
"github.com/golang/glog"

"github.com/flyteorg/flyte/datacatalog/cmd/entrypoints"
)

func main() {
Expand Down
3 changes: 1 addition & 2 deletions datacatalog/pkg/errors/errors_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package errors

import (
"testing"

"fmt"
"testing"

"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
Expand Down
3 changes: 2 additions & 1 deletion datacatalog/pkg/manager/impl/artifact_data_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package impl
import (
"context"

"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/flyteorg/flyte/flytestdlib/storage"
"google.golang.org/grpc/codes"
)

const artifactDataFile = "data.pb"
Expand Down
9 changes: 4 additions & 5 deletions datacatalog/pkg/manager/impl/artifact_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ import (
"strconv"
"time"

"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/impl/validators"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/interfaces"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"

"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/transformers"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/flytestdlib/storage"
"google.golang.org/grpc/codes"
)

type artifactMetrics struct {
Expand Down
14 changes: 7 additions & 7 deletions datacatalog/pkg/manager/impl/artifact_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ package impl
import (
"context"
stdErrors "errors"
"fmt"
"os"
"testing"
"time"

"fmt"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"github.com/flyteorg/flyte/datacatalog/pkg/errors"
Expand All @@ -20,12 +26,6 @@ import (
mockScope "github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/flytestdlib/storage"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion datacatalog/pkg/manager/impl/dataset_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"strconv"
"time"

"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/impl/validators"
Expand All @@ -16,7 +18,6 @@ import (
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/flyteorg/flyte/flytestdlib/storage"
"google.golang.org/grpc/codes"
)

type datasetMetrics struct {
Expand Down
12 changes: 6 additions & 6 deletions datacatalog/pkg/manager/impl/dataset_manager_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package impl

import (
"context"
"testing"

"context"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"github.com/flyteorg/flyte/datacatalog/pkg/errors"
Expand All @@ -14,11 +19,6 @@ import (
"github.com/flyteorg/flyte/flytestdlib/contextutils"
mockScope "github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func init() {
Expand Down
11 changes: 4 additions & 7 deletions datacatalog/pkg/manager/impl/reservation_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ import (
"context"
"time"

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

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/interfaces"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories"
repo_errors "github.com/flyteorg/flyte/datacatalog/pkg/repositories/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/transformers"

"github.com/flyteorg/flyte/datacatalog/pkg/manager/interfaces"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
)

type reservationMetrics struct {
Expand Down
13 changes: 6 additions & 7 deletions datacatalog/pkg/manager/impl/reservation_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ package impl
import (
"context"
"fmt"

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

"testing"
"time"

"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"

errors2 "github.com/flyteorg/flyte/datacatalog/pkg/errors"
errors3 "github.com/flyteorg/flyte/datacatalog/pkg/repositories/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/mocks"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
mockScope "github.com/flyteorg/flyte/flytestdlib/promutils"
)

var tagName = "tag"
Expand Down
4 changes: 1 addition & 3 deletions datacatalog/pkg/manager/impl/tag_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ import (
"context"
"time"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/impl/validators"
"github.com/flyteorg/flyte/datacatalog/pkg/manager/interfaces"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories"

"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/transformers"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/flytestdlib/contextutils"
"github.com/flyteorg/flyte/flytestdlib/logger"
"github.com/flyteorg/flyte/flytestdlib/promutils"
Expand Down
10 changes: 5 additions & 5 deletions datacatalog/pkg/manager/impl/tag_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"context"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/flyteorg/flyte/datacatalog/pkg/repositories/mocks"
"github.com/flyteorg/flyte/datacatalog/pkg/repositories/models"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"

"github.com/flyteorg/flyte/flytestdlib/contextutils"
mockScope "github.com/flyteorg/flyte/flytestdlib/promutils"
"github.com/flyteorg/flyte/flytestdlib/promutils/labeled"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions datacatalog/pkg/manager/impl/validators/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package validators
import (
"fmt"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/common"
"google.golang.org/grpc/codes"
"github.com/flyteorg/flyte/datacatalog/pkg/errors"
)

const missingFieldFormat = "missing %s"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"strconv"
"strings"

"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"google.golang.org/grpc/codes"
)

// The token is a string that should be opaque to the client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package validators
import (
"fmt"

"google.golang.org/grpc/codes"

"github.com/flyteorg/flyte/datacatalog/pkg/errors"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/datacatalog"
"google.golang.org/grpc/codes"
)

const (
Expand Down
Loading

0 comments on commit fa274e1

Please sign in to comment.