1
1
linters :
2
- enable-all : true
3
- disable :
4
- - dupl
5
- - errorlint
6
- - exhaustivestruct
7
- - funlen
8
- - gochecknoglobals
9
- - gochecknoinits
10
- - gocognit
11
- - godox
12
- - goerr113
13
- - gomnd
14
- - interfacer
15
- - lll
16
- - maligned
17
- - nlreturn
18
- - whitespace
19
- - wrapcheck
20
- - wsl
21
- # Run with --fast=false for more extensive checks
22
- fast : true
2
+ disable-all : true
3
+ enable :
4
+ - asciicheck
5
+ - bodyclose
6
+ - cyclop
7
+ - deadcode
8
+ - depguard
9
+ - dogsled
10
+ - durationcheck
11
+ - errcheck
12
+ - exportloopref
13
+ - forbidigo
14
+ - gci
15
+ - goconst
16
+ - gocritic
17
+ - gocyclo
18
+ - godot
19
+ - gofmt
20
+ - gofumpt
21
+ - goheader
22
+ - goimports
23
+ - gomodguard
24
+ - goprintffuncname
25
+ - gosec
26
+ - gosimple
27
+ - govet
28
+ - ifshort
29
+ - importas
30
+ - ineffassign
31
+ - makezero
32
+ - misspell
33
+ - nakedret
34
+ - nestif
35
+ - nilerr
36
+ - noctx
37
+ - nolintlint
38
+ - prealloc
39
+ - predeclared
40
+ - revive
41
+ - rowserrcheck
42
+ - sqlclosecheck
43
+ - staticcheck
44
+ - structcheck
45
+ - stylecheck
46
+ - thelper
47
+ - typecheck
48
+ - unconvert
49
+ - unparam
50
+ - unused
51
+ - varcheck
52
+ - wastedassign
53
+ - whitespace
54
+
23
55
linters-settings :
24
56
cyclop :
25
57
# TODO(sbuerin) fix remaining findings and set to 20 afterwards
26
58
max-complexity : 30
59
+ ifshort :
60
+ # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax.
61
+ max-decl-chars : 50
27
62
goimports :
28
63
local-prefixes : sigs.k8s.io/cluster-api-provider-openstack
64
+ importas :
65
+ no-unaliased : true
66
+ alias :
67
+ # Kubernetes
68
+ - pkg : k8s.io/api/core/v1
69
+ alias : corev1
70
+ - pkg : k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
71
+ alias : apiextensionsv1
72
+ - pkg : k8s.io/apimachinery/pkg/apis/meta/v1
73
+ alias : metav1
74
+ - pkg : k8s.io/apimachinery/pkg/api/errors
75
+ alias : apierrors
76
+ - pkg : k8s.io/apimachinery/pkg/util/errors
77
+ alias : kerrors
78
+ # Controller Runtime
79
+ - pkg : sigs.k8s.io/controller-runtime
80
+ alias : ctrl
81
+ staticcheck :
82
+ go : " 1.16"
83
+ stylecheck :
84
+ go : " 1.16"
29
85
nestif :
30
86
# minimal complexity of if statements to report, 5 by default
31
87
# TODO(sbuerin) fix remaining findings and set to 5 after:
@@ -34,16 +90,34 @@ linters-settings:
34
90
35
91
issues :
36
92
max-same-issues : 0
37
- max-per-linter : 0
93
+ max-issues- per-linter : 0
38
94
# List of regexps of issue texts to exclude, empty list by default.
39
- exclude :
40
- - Using the variable on range scope `(tc)|(rt)|(tt)|(test)|(testcase)|(testCase)` in function literal
41
- - " G108: Profiling endpoint is automatically exposed on /debug/pprof"
95
+ exclude-rules :
96
+ - linters :
97
+ - gosec
98
+ text : " G108: Profiling endpoint is automatically exposed on /debug/pprof"
99
+ - linters :
100
+ - gosec
101
+ text : " G108: Profiling endpoint is automatically exposed on /debug/pprof"
102
+ # This directive allows the embed package to be imported with an underscore everywhere.
103
+ - linters :
104
+ - revive
105
+ source : _ "embed"
106
+ - linters :
107
+ - revive
108
+ - stylecheck
109
+ path : (test)/.*.go
110
+ text : should not use dot imports
111
+ - linters :
112
+ - revive
113
+ path : test/e2e/shared/defaults.go
114
+ text : " exported: exported const .* should have comment \\ (or a comment on this block\\ ) or be unexported"
42
115
run :
43
- timeout : 6m
116
+ timeout : 10m
44
117
build-tags :
45
118
- e2e
46
119
47
120
skip-files :
48
121
- " zz_generated.*\\ .go$"
49
- - " .*_mock\\ .go"
122
+ - " .*conversion.*\\ .go$"
123
+ allow-parallel-runners : true
0 commit comments