12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ version : " 2"
15
16
run :
16
17
modules-download-mode : readonly
17
- timeout : 20m
18
-
19
18
linters :
19
+ default : none
20
20
enable :
21
21
- asciicheck
22
22
- bidichk
@@ -31,8 +31,6 @@ linters:
31
31
- gocritic
32
32
- gocyclo
33
33
- godot
34
- - gofmt
35
- - gosimple
36
34
- govet
37
35
- importas
38
36
- ineffassign
@@ -48,47 +46,65 @@ linters:
48
46
- usetesting
49
47
- wastedassign
50
48
- whitespace
51
- disable-all : true
52
-
49
+ settings :
50
+ depguard :
51
+ rules :
52
+ main :
53
+ deny :
54
+ - pkg : io/ioutil
55
+ desc : https://go.dev/doc/go1.16#ioutil
56
+ - pkg : github.com/ghodss/yaml
57
+ desc : use sigs.k8s.io/yaml instead
58
+ importas :
59
+ alias :
60
+ # Sync Agent APIs
61
+ - pkg : github.com/kcp-dev/api-syncagent/sdk/apis/(\w+)/(v[\w\d]+)
62
+ alias : $1$2
63
+ # Kubernetes
64
+ - pkg : k8s.io/api/(\w+)/(v[\w\d]+)
65
+ alias : $1$2
66
+ - pkg : k8s.io/apimachinery/pkg/apis/meta/v1
67
+ alias : metav1
68
+ - pkg : k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
69
+ alias : apiextensionsv1
70
+ - pkg : k8s.io/apimachinery/pkg/api/errors
71
+ alias : apierrors
72
+ - pkg : k8s.io/apimachinery/pkg/util/errors
73
+ alias : utilerrors
74
+ # Controller Runtime
75
+ - pkg : sigs.k8s.io/controller-runtime/pkg/client
76
+ alias : ctrlruntimeclient
77
+ no-unaliased : true
78
+ exclusions :
79
+ generated : lax
80
+ presets :
81
+ - comments
82
+ - common-false-positives
83
+ - legacy
84
+ - std-error-handling
85
+ rules :
86
+ # gocritic
87
+ - path : (.+)\.go$
88
+ text : singleCaseSwitch # in most cases this is the beginning of a lookup table and should be kept an obvious table
89
+ # staticcheck
90
+ - path : (.+)\.go$
91
+ text : QF1008 # embedded field names in selectors often make the code more readable, though more verbose
92
+ paths :
93
+ - zz_generated.*.go
94
+ - third_party$
95
+ - builtin$
96
+ - examples$
53
97
issues :
54
98
# defaults to 3, which often needlessly hides issues and forces
55
99
# to re-run the linter across the entire repo many times
56
100
max-same-issues : 0
57
-
58
- exclude-files :
59
- - zz_generated.*.go
60
-
61
- # NOTE: Do not use commas in the exclude patterns, or else the regex will be
62
- # split and you will be sad: https://github.com/golangci/golangci-lint/issues/665
63
- exclude :
64
- # gocritic
65
- - singleCaseSwitch # in most cases this is the beginning of a lookup table and should be kept an obvious table
66
-
67
- linters-settings :
68
- depguard :
69
- rules :
70
- main :
71
- deny :
72
- - { pkg: io/ioutil, desc: https://go.dev/doc/go1.16#ioutil }
73
- - { pkg: github.com/ghodss/yaml, desc: use sigs.k8s.io/yaml instead }
74
-
75
- importas :
76
- no-unaliased : true
77
- alias :
78
- # Sync Agent APIs
79
- - pkg : github.com/kcp-dev/api-syncagent/sdk/apis/(\w+)/(v[\w\d]+)
80
- alias : $1$2
81
- # Kubernetes
82
- - pkg : k8s.io/api/(\w+)/(v[\w\d]+)
83
- alias : $1$2
84
- - pkg : k8s.io/apimachinery/pkg/apis/meta/v1
85
- alias : metav1
86
- - pkg : k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
87
- alias : apiextensionsv1
88
- - pkg : k8s.io/apimachinery/pkg/api/errors
89
- alias : apierrors
90
- - pkg : k8s.io/apimachinery/pkg/util/errors
91
- alias : utilerrors
92
- # Controller Runtime
93
- - pkg : sigs.k8s.io/controller-runtime/pkg/client
94
- alias : ctrlruntimeclient
101
+ formatters :
102
+ enable :
103
+ - gofmt
104
+ exclusions :
105
+ generated : lax
106
+ paths :
107
+ - zz_generated.*.go
108
+ - third_party$
109
+ - builtin$
110
+ - examples$
0 commit comments