Skip to content

Commit 0047207

Browse files
authored
chore: enable goimports linter (#669)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent bfdad63 commit 0047207

14 files changed

+30
-15
lines changed

.golangci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ linters:
1111
# - errorlint
1212
- gocritic
1313
- gofumpt
14-
# - goimports
14+
- goimports
1515
- gomodguard
1616
- gosimple
1717
- govet
@@ -43,6 +43,8 @@ linters-settings:
4343
- typeSwitchVar
4444
- unlambda #FIXME
4545
- wrapperFunc #FIXME
46+
goimports:
47+
local-prefixes: github.com/argoproj/gitops-engine
4648
revive:
4749
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
4850
rules:

pkg/cache/references_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package cache
33
import (
44
"testing"
55

6-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
76
"github.com/stretchr/testify/assert"
87
appsv1 "k8s.io/api/apps/v1"
98
corev1 "k8s.io/api/core/v1"
109
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1110
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
11+
12+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1213
)
1314

1415
func Test_isStatefulSetChild(t *testing.T) {

pkg/diff/diff_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"strings"
1111
"testing"
1212

13-
"github.com/argoproj/gitops-engine/pkg/diff/mocks"
14-
"github.com/argoproj/gitops-engine/pkg/diff/testdata"
1513
openapi_v2 "github.com/google/gnostic-models/openapiv2"
1614
"github.com/stretchr/testify/assert"
1715
"github.com/stretchr/testify/mock"
@@ -29,6 +27,9 @@ import (
2927
"k8s.io/klog/v2/textlogger"
3028
openapiproto "k8s.io/kube-openapi/pkg/util/proto"
3129
"sigs.k8s.io/yaml"
30+
31+
"github.com/argoproj/gitops-engine/pkg/diff/mocks"
32+
"github.com/argoproj/gitops-engine/pkg/diff/testdata"
3233
)
3334

3435
func printDiff(result *DiffResult) (string, error) {

pkg/health/health.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package health
22

33
import (
4-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
54
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
65
"k8s.io/apimachinery/pkg/runtime/schema"
6+
7+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
78
)
89

910
// Represents resource health status

pkg/health/health_apiservice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package health
33
import (
44
"fmt"
55

6-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
76
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
87
"k8s.io/apimachinery/pkg/runtime"
98
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
109
apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1"
10+
11+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1112
)
1213

1314
func getAPIServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

pkg/health/health_daemonset.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package health
33
import (
44
"fmt"
55

6-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
76
appsv1 "k8s.io/api/apps/v1"
87
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
98
"k8s.io/apimachinery/pkg/runtime"
9+
10+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1011
)
1112

1213
func getDaemonSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

pkg/health/health_deployment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package health
33
import (
44
"fmt"
55

6-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
76
appsv1 "k8s.io/api/apps/v1"
87
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
98
"k8s.io/apimachinery/pkg/runtime"
9+
10+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1011
)
1112

1213
func getDeploymentHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

pkg/health/health_job.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ import (
55

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

8-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
98
batchv1 "k8s.io/api/batch/v1"
109
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
1110
"k8s.io/apimachinery/pkg/runtime"
11+
12+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1213
)
1314

1415
func getJobHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

pkg/health/health_pod.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
87
corev1 "k8s.io/api/core/v1"
98
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
109
"k8s.io/apimachinery/pkg/runtime"
1110
"k8s.io/kubectl/pkg/util/podutils"
11+
12+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1213
)
1314

1415
func getPodHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

pkg/health/health_pvc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package health
33
import (
44
"fmt"
55

6-
"github.com/argoproj/gitops-engine/pkg/utils/kube"
76
corev1 "k8s.io/api/core/v1"
87
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
98
"k8s.io/apimachinery/pkg/runtime"
9+
10+
"github.com/argoproj/gitops-engine/pkg/utils/kube"
1011
)
1112

1213
func getPVCHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {

0 commit comments

Comments
 (0)