Skip to content

Commit 7b29210

Browse files
committed
Migrate config file to v2
1 parent afa8b9a commit 7b29210

File tree

1 file changed

+57
-59
lines changed

1 file changed

+57
-59
lines changed

.golangci.yaml

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
version: "2"
2+
13
run:
24
concurrency: 4
3-
timeout: 10m
45

56
linters:
67
enable:
@@ -14,68 +15,65 @@ linters:
1415
- nolintlint
1516
- prealloc
1617
- revive
17-
- stylecheck
18+
- staticcheck
1819
- unconvert
1920
- unparam
2021
- whitespace
2122

22-
linters-settings:
23-
importas:
24-
alias:
25-
- pkg: github.com/timebertt/kubernetes-controller-sharding/apis/(\w+)/(v[\w\d]+)
26-
alias: $1$2
27-
- pkg: github.com/timebertt/kubernetes-controller-sharding/webhosting-operator/apis/(\w+)/(v[\w\d]+)
28-
alias: $1$2
29-
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
30-
alias: $1$2
31-
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
32-
alias: $1$2
33-
- pkg: k8s.io/apimachinery/pkg/api/([^m]\w+)
34-
alias: api${1}
35-
- pkg: k8s.io/apimachinery/pkg/util/(\w+)
36-
alias: util${1}
37-
- pkg: k8s.io/client-go/tools/clientcmd/api/(\w+)
38-
alias: clientcmd${1}
39-
- pkg: k8s.io/client-go/tools/cache
40-
alias: toolscache
41-
- pkg: k8s.io/component-base/config/(v[\w\d]+)
42-
alias: componentbaseconfig$1
43-
- pkg: k8s.io/utils/clock/testing
44-
alias: testclock
45-
- pkg: sigs.k8s.io/controller-runtime/pkg/client/fake
46-
alias: fakeclient
47-
- pkg: sigs.k8s.io/controller-runtime/pkg/log/zap
48-
alias: logzap
49-
- pkg: sigs.k8s.io/controller-runtime/pkg/log
50-
alias: logf
51-
misspell:
52-
locale: US
53-
nolintlint:
54-
require-specific: true
55-
revive:
56-
rules:
57-
- name: context-as-argument
58-
- name: duplicated-imports
59-
- name: early-return
60-
- name: exported
61-
- name: unreachable-code
23+
settings:
24+
importas:
25+
alias:
26+
- pkg: github.com/timebertt/kubernetes-controller-sharding/apis/(\w+)/(v[\w\d]+)
27+
alias: $1$2
28+
- pkg: github.com/timebertt/kubernetes-controller-sharding/webhosting-operator/apis/(\w+)/(v[\w\d]+)
29+
alias: $1$2
30+
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
31+
alias: $1$2
32+
- pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+)
33+
alias: $1$2
34+
- pkg: k8s.io/apimachinery/pkg/api/([^m]\w+)
35+
alias: api${1}
36+
- pkg: k8s.io/apimachinery/pkg/util/(\w+)
37+
alias: util${1}
38+
- pkg: k8s.io/client-go/tools/clientcmd/api/(\w+)
39+
alias: clientcmd${1}
40+
- pkg: k8s.io/client-go/tools/cache
41+
alias: toolscache
42+
- pkg: k8s.io/component-base/config/(v[\w\d]+)
43+
alias: componentbaseconfig$1
44+
- pkg: k8s.io/utils/clock/testing
45+
alias: testclock
46+
- pkg: sigs.k8s.io/controller-runtime/pkg/client/fake
47+
alias: fakeclient
48+
- pkg: sigs.k8s.io/controller-runtime/pkg/log/zap
49+
alias: logzap
50+
- pkg: sigs.k8s.io/controller-runtime/pkg/log
51+
alias: logf
52+
misspell:
53+
locale: US
54+
nolintlint:
55+
require-specific: true
56+
revive:
57+
rules:
58+
- name: context-as-argument
59+
- name: duplicated-imports
60+
- name: early-return
61+
- name: exported
62+
- name: unreachable-code
6263

63-
issues:
64-
exclude-files:
65-
- "zz_generated\\..*\\.go$"
64+
exclusions:
65+
generated: strict
6666

67-
exclude-rules:
68-
- linters:
69-
- stylecheck
70-
text: "ST1003:.+func SetDefaults_"
71-
- linters:
72-
- stylecheck
73-
text: "ST1001: should not use dot imports"
74-
path: "pkg/utils/test"
75-
- linters:
76-
- nolintlint
77-
text: "should be written without leading space"
67+
presets:
68+
- comments
69+
- common-false-positives
70+
- std-error-handling
7871

79-
exclude:
80-
# ginkgolinter false positive: https://github.com/nunnatsa/ginkgolinter/issues/190
81-
- the MatchError matcher used to assert a non error type \(ctx\)
72+
rules:
73+
- linters:
74+
- staticcheck
75+
path: pkg/utils/test
76+
text: 'ST1001: should not use dot imports'
77+
- linters:
78+
- nolintlint
79+
text: should be written without leading space

0 commit comments

Comments
 (0)