1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ version : " 2"
1516run :
1617 modules-download-mode : readonly
17- timeout : 20m
18-
1918linters :
19+ default : none
2020 enable :
2121 - asciicheck
2222 - bidichk
@@ -31,8 +31,6 @@ linters:
3131 - gocritic
3232 - gocyclo
3333 - godot
34- - gofmt
35- - gosimple
3634 - govet
3735 - importas
3836 - ineffassign
@@ -48,47 +46,65 @@ linters:
4846 - usetesting
4947 - wastedassign
5048 - 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$
5397issues :
5498 # defaults to 3, which often needlessly hides issues and forces
5599 # to re-run the linter across the entire repo many times
56100 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