@@ -11,18 +11,20 @@ linters:
11
11
- goconst
12
12
- gocritic
13
13
- gocyclo
14
+ - godot
14
15
- gofmt
15
16
- goimports
16
- - golint
17
17
- goprintffuncname
18
18
- gosec
19
19
- gosimple
20
20
- govet
21
+ - importas
21
22
- ineffassign
22
23
- misspell
23
24
- nakedret
24
25
- nolintlint
25
26
- prealloc
27
+ - revive
26
28
- rowserrcheck
27
29
- staticcheck
28
30
- structcheck
@@ -31,9 +33,31 @@ linters:
31
33
- unconvert
32
34
- unparam
33
35
- varcheck
34
- - godot
35
36
- whitespace
36
37
38
+ linters-settings :
39
+ staticcheck :
40
+ go : " 1.16"
41
+ stylecheck :
42
+ go : " 1.16"
43
+ importas :
44
+ no-unaliased : true
45
+ alias :
46
+ # Kubernetes
47
+ - pkg : k8s.io/api/core/v1
48
+ alias : corev1
49
+ - pkg : k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
50
+ alias : apiextensionsv1
51
+ - pkg : k8s.io/apimachinery/pkg/apis/meta/v1
52
+ alias : metav1
53
+ - pkg : k8s.io/apimachinery/pkg/api/errors
54
+ alias : apierrors
55
+ - pkg : k8s.io/apimachinery/pkg/util/errors
56
+ alias : kerrors
57
+ # Controller Runtime
58
+ - pkg : sigs.k8s.io/controller-runtime
59
+ alias : ctrl
60
+
37
61
issues :
38
62
max-same-issues : 0
39
63
max-issues-per-linter : 0
@@ -44,30 +68,30 @@ issues:
44
68
exclude :
45
69
- " G108: Profiling endpoint is automatically exposed on /debug/pprof"
46
70
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
47
- - exported method `.* .(Reconcile|SetupWithManager|SetupWebhookWithManager)` should have comment or be unexported
71
+ - " exported: exported method .* \\ .(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
48
72
# The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
49
73
# If it is decided they will not be addressed they should be moved above this comment.
50
74
- Subprocess launch(ed with variable|ing should be audited)
51
75
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
52
76
- (G104|G307)
53
77
exclude-rules :
54
78
# With Go 1.16, the new embed directive can be used with an un-named import,
55
- # golint only allows these to be imported in a main.go, which wouldn't work for us.
79
+ # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
56
80
# This directive allows the embed package to be imported with an underscore everywhere.
57
81
- linters :
58
- - golint
82
+ - revive
59
83
source : _ "embed"
60
84
# Exclude some packages or code to require comments, for example test code, or fake clients.
61
85
- linters :
62
- - golint
86
+ - revive
63
87
text : exported (method|function|type|const) (.+) should have comment or be unexported
64
88
source : (func|type).*Fake.*
65
89
- linters :
66
- - golint
90
+ - revive
67
91
text : exported (method|function|type|const) (.+) should have comment or be unexported
68
92
path : fake_\.go
69
93
- linters :
70
- - golint
94
+ - revive
71
95
text : exported (method|function|type|const) (.+) should have comment or be unexported
72
96
path : .*test/(providers|framework|e2e).*.go
73
97
# Disable unparam "always receives" which might not be really
@@ -83,6 +107,10 @@ issues:
83
107
text : cyclomatic complexity
84
108
- path : test/(framework|e2e).*.go
85
109
text : should not use dot imports
110
+ # Append should be able to assign to a different var/slice.
111
+ - linters :
112
+ - gocritic
113
+ text : " appendAssign: append result not assigned to the same slice"
86
114
87
115
run :
88
116
timeout : 10m
0 commit comments