Merge pull request #2094 from wuyingjun-lucky/gci

Add gci to seperate goimports to three parts
This commit is contained in:
karmada-bot 2022-07-04 09:28:26 +08:00 committed by GitHub
commit 417dc98478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -42,6 +42,7 @@ linters:
- unused - unused
- varcheck - varcheck
# other linters supported by golangci-lint. # other linters supported by golangci-lint.
- gci
- gocyclo - gocyclo
- gosec - gosec
- misspell - misspell
@ -54,6 +55,11 @@ linters-settings:
gocyclo: gocyclo:
# minimal cyclomatic complexity to report # minimal cyclomatic complexity to report
min-complexity: 15 min-complexity: 15
gci:
sections:
- Standard
- Default
- Prefix(github.com/karmada-io/karmada)
issues: issues:
# The list of ids of default excludes to include or disable. By default it's empty. # The list of ids of default excludes to include or disable. By default it's empty.
@ -63,3 +69,12 @@ issues:
- EXC0012 - EXC0012
- EXC0013 - EXC0013
- EXC0014 - EXC0014
exclude-rules:
# Exclude 'cmd/agent/main.go' and 'cmd/controller-manager/controller-manager.go'
# because 'sigs.k8s.io/controller-runtime/pkg/metrics' package should be set before 'k8s.io/apiserver/pkg/server' .
- path: cmd/agent/main.go
linters:
- gci
- path: cmd/controller-manager/controller-manager.go
linters:
- gci

View File

@ -1,9 +1,9 @@
package kubernetes package kubernetes
import ( import (
"github.com/karmada-io/karmada/pkg/karmadactl/cmdinit/utils"
rbacv1 "k8s.io/api/rbac/v1" rbacv1 "k8s.io/api/rbac/v1"
"github.com/karmada-io/karmada/pkg/karmadactl/cmdinit/utils"
) )
// CreateControllerManagerRBAC karmada-controller-manager ClusterRole and ClusterRoleBinding // CreateControllerManagerRBAC karmada-controller-manager ClusterRole and ClusterRoleBinding