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

chore: enable goimports linter #669

Merged
merged 1 commit into from
Feb 7, 2025
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
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linters:
# - errorlint
- gocritic
- gofumpt
# - goimports
- goimports
- gomodguard
- gosimple
- govet
Expand Down Expand Up @@ -43,6 +43,8 @@ linters-settings:
- typeSwitchVar
- unlambda #FIXME
- wrapperFunc #FIXME
goimports:
local-prefixes: github.com/argoproj/gitops-engine
revive:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
rules:
Expand Down
3 changes: 2 additions & 1 deletion pkg/cache/references_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package cache
import (
"testing"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
"github.com/stretchr/testify/assert"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func Test_isStatefulSetChild(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"strings"
"testing"

"github.com/argoproj/gitops-engine/pkg/diff/mocks"
"github.com/argoproj/gitops-engine/pkg/diff/testdata"
openapi_v2 "github.com/google/gnostic-models/openapiv2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand All @@ -29,6 +27,9 @@ import (
"k8s.io/klog/v2/textlogger"
openapiproto "k8s.io/kube-openapi/pkg/util/proto"
"sigs.k8s.io/yaml"

"github.com/argoproj/gitops-engine/pkg/diff/mocks"
"github.com/argoproj/gitops-engine/pkg/diff/testdata"
)

func printDiff(result *DiffResult) (string, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package health

import (
"github.com/argoproj/gitops-engine/pkg/utils/kube"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

// Represents resource health status
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_apiservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getAPIServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getDaemonSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getDeploymentHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (

corev1 "k8s.io/api/core/v1"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
batchv1 "k8s.io/api/batch/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getJobHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"fmt"
"strings"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/kubectl/pkg/util/podutils"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getPodHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getPVCHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getReplicaSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/health/health_statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package health
import (
"fmt"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

func getStatefulSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/utils/kube/kubetest/mock_resource_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"context"
"sync"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
cmdutil "k8s.io/kubectl/pkg/cmd/util"

"github.com/argoproj/gitops-engine/pkg/utils/kube"
)

type MockResourceOps struct {
Expand Down
Loading