Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace goimports with gci #3202

Merged
merged 2 commits into from
Jan 14, 2024
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
3 changes: 2 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ linters-settings:
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/cmd/cli'
- pkg: 'go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker'
gci:
custom-order: true
sections:
- standard
- default
Expand All @@ -127,7 +128,6 @@ linters:
- bidichk
- errcheck
- gofmt
- goimports
- gosimple
- govet
- ineffassign
Expand Down Expand Up @@ -165,6 +165,7 @@ linters:
- stylecheck
- contextcheck
- forcetypeassert
- gci

run:
timeout: 15m
4 changes: 2 additions & 2 deletions agent/rpc/auth_client_grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"context"
"time"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc/proto"

"google.golang.org/grpc"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc/proto"
)

type AuthClient struct {
Expand Down
3 changes: 1 addition & 2 deletions cli/pipeline/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ import (
"strings"
"text/template"

"go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker"

"github.com/urfave/cli/v2"

"go.woodpecker-ci.org/woodpecker/v2/cli/common"
"go.woodpecker-ci.org/woodpecker/v2/cli/internal"
"go.woodpecker-ci.org/woodpecker/v2/woodpecker-go/woodpecker"
)

var pipelineCreateCmd = &cli.Command{
Expand Down
1 change: 0 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/urfave/cli/v2"

_ "go.woodpecker-ci.org/woodpecker/v2/cmd/server/docs"

"go.woodpecker-ci.org/woodpecker/v2/version"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import (
woodpeckerGrpcServer "go.woodpecker-ci.org/woodpecker/v2/server/grpc"
"go.woodpecker-ci.org/woodpecker/v2/server/logging"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
// "go.woodpecker-ci.org/woodpecker/v2/server/plugins/encryption"
// encryptedStore "go.woodpecker-ci.org/woodpecker/v2/server/plugins/encryption/wrapper/store"
"go.woodpecker-ci.org/woodpecker/v2/server/plugins/permissions"
"go.woodpecker-ci.org/woodpecker/v2/server/pubsub"
"go.woodpecker-ci.org/woodpecker/v2/server/router"
Expand All @@ -51,8 +53,6 @@ import (
"go.woodpecker-ci.org/woodpecker/v2/shared/constant"
"go.woodpecker-ci.org/woodpecker/v2/shared/logger"
"go.woodpecker-ci.org/woodpecker/v2/version"
// "go.woodpecker-ci.org/woodpecker/v2/server/plugins/encryption"
// encryptedStore "go.woodpecker-ci.org/woodpecker/v2/server/plugins/encryption/wrapper/store"
)

func run(c *cli.Context) error {
Expand Down
10 changes: 4 additions & 6 deletions pipeline/backend/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,19 @@ import (
"time"

"github.com/rs/zerolog/log"
"gopkg.in/yaml.v3"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"

"github.com/urfave/cli/v2"
"gopkg.in/yaml.v3"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
// To authenticate to GCP K8s clusters
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"

// To authenticate to GCP K8s clusters
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

const (
Expand Down
1 change: 1 addition & 0 deletions pipeline/backend/kubernetes/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/kinbiko/jsonassert"
"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

Expand Down
1 change: 1 addition & 0 deletions pipeline/backend/kubernetes/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

Expand Down
1 change: 1 addition & 0 deletions pipeline/backend/local/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"strings"

"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

Expand Down
1 change: 1 addition & 0 deletions pipeline/frontend/metadata/drone_compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/metadata"
)

Expand Down
1 change: 1 addition & 0 deletions pipeline/frontend/yaml/compiler/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

backend_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

Expand Down
1 change: 1 addition & 0 deletions pipeline/frontend/yaml/compiler/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

backend_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
)

Expand Down
4 changes: 2 additions & 2 deletions pipeline/frontend/yaml/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package matrix
import (
"strings"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/errors"

"codeberg.org/6543/xyaml"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/errors"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions pipeline/frontend/yaml/types/base/base_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ import (
"fmt"
"testing"

"gopkg.in/yaml.v3"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)

type StructStringorInt struct {
Expand Down
3 changes: 1 addition & 2 deletions pipeline/frontend/yaml/types/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ package types
import (
"testing"

"gopkg.in/yaml.v3"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)

func TestMarshalNetworks(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions pipeline/frontend/yaml/types/volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ package types
import (
"testing"

"gopkg.in/yaml.v3"

"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)

func TestMarshalVolumes(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions server/api/global_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ import (

"github.com/gin-gonic/gin"

"go.woodpecker-ci.org/woodpecker/v2/server/router/middleware/session"

"go.woodpecker-ci.org/woodpecker/v2/server"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
"go.woodpecker-ci.org/woodpecker/v2/server/router/middleware/session"
)

// GetGlobalSecretList
Expand Down
3 changes: 1 addition & 2 deletions server/api/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import (
"strconv"
"strings"

"github.com/rs/zerolog/log"

"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/server"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
Expand Down
3 changes: 1 addition & 2 deletions server/api/org_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ import (

"github.com/gin-gonic/gin"

"go.woodpecker-ci.org/woodpecker/v2/server/router/middleware/session"

"go.woodpecker-ci.org/woodpecker/v2/server"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
"go.woodpecker-ci.org/woodpecker/v2/server/router/middleware/session"
)

// GetOrgSecret
Expand Down
1 change: 1 addition & 0 deletions server/api/signature_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/server"
)

Expand Down
1 change: 1 addition & 0 deletions server/badges/badges_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
4 changes: 2 additions & 2 deletions server/cache/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"fmt"
"time"

"github.com/jellydator/ttlcache/v3"

"go.woodpecker-ci.org/woodpecker/v2/server/forge"
"go.woodpecker-ci.org/woodpecker/v2/server/model"

"github.com/jellydator/ttlcache/v3"
)

// MembershipService is a service to check for user membership.
Expand Down
4 changes: 2 additions & 2 deletions server/forge/bitbucket/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"net/http"
"net/url"

shared_utils "go.woodpecker-ci.org/woodpecker/v2/shared/utils"

"golang.org/x/oauth2"
"golang.org/x/oauth2/bitbucket"

shared_utils "go.woodpecker-ci.org/woodpecker/v2/shared/utils"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion server/grpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (

"github.com/franela/goblin"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/metadata"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
mocks_store "go.woodpecker-ci.org/woodpecker/v2/server/store/mocks"
"google.golang.org/grpc/metadata"
)

func TestRegisterAgent(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions server/logging/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
5 changes: 2 additions & 3 deletions server/pipeline/stepbuilder/stepBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ import (

backend_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/backend/types"
pipeline_errors "go.woodpecker-ci.org/woodpecker/v2/pipeline/errors"
yaml_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/types"
forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types"

"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/metadata"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/compiler"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/linter"
"go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/matrix"
yaml_types "go.woodpecker-ci.org/woodpecker/v2/pipeline/frontend/yaml/types"
"go.woodpecker-ci.org/woodpecker/v2/server"
forge_types "go.woodpecker-ci.org/woodpecker/v2/server/forge/types"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
1 change: 1 addition & 0 deletions server/pipeline/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"strconv"

"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/server"
"go.woodpecker-ci.org/woodpecker/v2/server/model"
"go.woodpecker-ci.org/woodpecker/v2/server/pubsub"
Expand Down
4 changes: 2 additions & 2 deletions server/plugins/encryption/aes_encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"errors"
"fmt"

"go.woodpecker-ci.org/woodpecker/v2/server/store/types"
"golang.org/x/crypto/bcrypt"

"golang.org/x/crypto/sha3"

"go.woodpecker-ci.org/woodpecker/v2/server/store/types"
)

func (svc *aesEncryptionService) loadCipher(password string) error {
Expand Down
1 change: 1 addition & 0 deletions server/plugins/permissions/repo_owners_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
1 change: 1 addition & 0 deletions server/plugins/secrets/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/franela/goblin"
"github.com/stretchr/testify/mock"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
"go.woodpecker-ci.org/woodpecker/v2/server/plugins/secrets"
mocks_store "go.woodpecker-ci.org/woodpecker/v2/server/store/mocks"
Expand Down
1 change: 1 addition & 0 deletions server/plugins/utils/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (

"github.com/go-ap/httpsig"
"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/server/plugins/utils"
)

Expand Down
4 changes: 2 additions & 2 deletions server/queue/fifo.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"sync"
"time"

"go.woodpecker-ci.org/woodpecker/v2/server/model"

"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

type entry struct {
Expand Down
1 change: 1 addition & 0 deletions server/queue/fifo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/stretchr/testify/assert"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
1 change: 1 addition & 0 deletions server/router/middleware/session/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"strconv"

"github.com/gin-gonic/gin"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
)

Expand Down
1 change: 0 additions & 1 deletion server/router/middleware/session/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/rs/zerolog/log"

"go.woodpecker-ci.org/woodpecker/v2/server"

"go.woodpecker-ci.org/woodpecker/v2/server/model"
"go.woodpecker-ci.org/woodpecker/v2/server/store"
"go.woodpecker-ci.org/woodpecker/v2/server/store/types"
Expand Down
Loading
Loading