|
1 | | -# https://golangci-lint.run/usage/configuration/ |
2 | | -version: "1" |
3 | | - |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + build-tags: |
| 4 | + - envtest |
4 | 5 | linters: |
5 | | - disable: |
6 | | - - contextcheck |
7 | | - - gci |
8 | | - - gofumpt |
9 | | - - goimports |
10 | 6 | enable: |
| 7 | + - asasalint |
| 8 | + - asciicheck |
| 9 | + - bidichk |
| 10 | + - bodyclose |
11 | 11 | - depguard |
| 12 | + - durationcheck |
| 13 | + - errorlint |
| 14 | + - exhaustive |
| 15 | + - gocheckcompilerdirectives |
| 16 | + - gochecksumtype |
12 | 17 | - gomodguard |
13 | | - - gosimple |
| 18 | + - gosec |
| 19 | + - gosmopolitan |
14 | 20 | - importas |
| 21 | + - loggercheck |
| 22 | + - makezero |
15 | 23 | - misspell |
| 24 | + - musttag |
| 25 | + - nilerr |
| 26 | + - nilnesserr |
| 27 | + - noctx |
| 28 | + - protogetter |
| 29 | + - reassign |
| 30 | + - recvcheck |
| 31 | + - rowserrcheck |
| 32 | + - spancheck |
| 33 | + - sqlclosecheck |
| 34 | + - testifylint |
16 | 35 | - unconvert |
17 | | - presets: |
18 | | - - bugs |
19 | | - - format |
20 | | - - unused |
21 | | - |
22 | | -linters-settings: |
23 | | - gci: |
24 | | - sections: |
25 | | - - standard |
26 | | - - default |
27 | | - - prefix(github.com/percona) |
28 | | - |
29 | | - depguard: |
30 | | - rules: |
31 | | - everything: |
32 | | - deny: |
33 | | - - pkg: io/ioutil |
34 | | - desc: > |
35 | | - Use the "io" and "os" packages instead. |
36 | | - See https://go.dev/doc/go1.16#ioutil |
37 | | -
|
38 | | - not-tests: |
39 | | - files: ['!$test'] |
40 | | - deny: |
41 | | - - pkg: net/http/httptest |
42 | | - desc: Should be used only in tests. |
43 | | - |
44 | | - - pkg: testing/* |
45 | | - desc: The "testing" packages should be used only in tests. |
46 | | - |
47 | | - - pkg: github.com/percona/percona-postgresql-operator/internal/testing/* |
48 | | - desc: The "internal/testing" packages should be used only in tests. |
49 | | - |
50 | | - tests: |
51 | | - files: ['$test'] |
52 | | - deny: |
53 | | - - pkg: github.com/pkg/errors |
54 | | - desc: Use the "errors" package unless you are interacting with stack traces. |
55 | | - |
56 | | - errchkjson: |
57 | | - check-error-free-encoding: true |
58 | | - |
59 | | - exhaustive: |
60 | | - default-signifies-exhaustive: true |
61 | | - |
62 | | - gomodguard: |
63 | | - blocked: |
64 | | - modules: |
65 | | - - gopkg.in/yaml.v2: { recommendations: [sigs.k8s.io/yaml] } |
66 | | - - gopkg.in/yaml.v3: { recommendations: [sigs.k8s.io/yaml] } |
67 | | - - gotest.tools: { recommendations: [gotest.tools/v3] } |
68 | | - - k8s.io/kubernetes: |
69 | | - reason: > |
70 | | - k8s.io/kubernetes is for managing dependencies of the Kubernetes |
71 | | - project, i.e. building kubelet and kubeadm. |
72 | | -
|
73 | | - importas: |
74 | | - alias: |
75 | | - - pkg: k8s.io/api/(\w+)/(v[\w\w]+) |
76 | | - alias: $1$2 |
77 | | - - pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+) |
78 | | - alias: $1$2 |
79 | | - no-unaliased: true |
80 | | - |
81 | | -run: |
82 | | - build-tags: |
83 | | - - envtest |
84 | | -issues: |
85 | | - exclude-generated: strict |
86 | | - exclude-rules: |
87 | | - # These value types have unmarshal methods. |
88 | | - # https://github.com/raeperd/recvcheck/issues/7 |
89 | | - - linters: [recvcheck] |
90 | | - path: internal/pki/pki.go |
91 | | - text: 'methods of "(Certificate|PrivateKey)"' |
| 36 | + - unparam |
| 37 | + - zerologlint |
| 38 | + disable: |
| 39 | + - contextcheck |
| 40 | + - errchkjson |
| 41 | + settings: |
| 42 | + depguard: |
| 43 | + rules: |
| 44 | + everything: |
| 45 | + deny: |
| 46 | + - pkg: io/ioutil |
| 47 | + desc: | |
| 48 | + Use the "io" and "os" packages instead. See https://go.dev/doc/go1.16#ioutil |
| 49 | + not-tests: |
| 50 | + files: |
| 51 | + - '!$test' |
| 52 | + deny: |
| 53 | + - pkg: net/http/httptest |
| 54 | + desc: Should be used only in tests. |
| 55 | + - pkg: testing/* |
| 56 | + desc: The "testing" packages should be used only in tests. |
| 57 | + - pkg: github.com/percona/percona-postgresql-operator/internal/testing/* |
| 58 | + desc: The "internal/testing" packages should be used only in tests. |
| 59 | + exhaustive: |
| 60 | + default-signifies-exhaustive: true |
| 61 | + gomodguard: |
| 62 | + blocked: |
| 63 | + modules: |
| 64 | + - gopkg.in/yaml.v2: |
| 65 | + recommendations: |
| 66 | + - sigs.k8s.io/yaml |
| 67 | + - gopkg.in/yaml.v3: |
| 68 | + recommendations: |
| 69 | + - sigs.k8s.io/yaml |
| 70 | + - gotest.tools: |
| 71 | + recommendations: |
| 72 | + - gotest.tools/v3 |
| 73 | + - k8s.io/kubernetes: |
| 74 | + reason: | |
| 75 | + k8s.io/kubernetes is for managing dependencies of the Kubernetes project, i.e. building kubelet and kubeadm. |
| 76 | + importas: |
| 77 | + alias: |
| 78 | + - pkg: k8s.io/api/(\w+)/(v[\w\w]+) |
| 79 | + alias: $1$2 |
| 80 | + - pkg: k8s.io/apimachinery/pkg/apis/(\w+)/(v[\w\d]+) |
| 81 | + alias: $1$2 |
| 82 | + no-unaliased: true |
| 83 | + exclusions: |
| 84 | + generated: lax |
| 85 | + presets: |
| 86 | + - comments |
| 87 | + - common-false-positives |
| 88 | + - legacy |
| 89 | + - std-error-handling |
| 90 | + paths: |
| 91 | + - pkg/generated |
| 92 | + - hack |
| 93 | + - third_party$ |
| 94 | + - builtin$ |
| 95 | + - examples$ |
| 96 | +formatters: |
| 97 | + enable: |
| 98 | + - gofmt |
| 99 | + settings: |
| 100 | + gci: |
| 101 | + sections: |
| 102 | + - standard |
| 103 | + - default |
| 104 | + - prefix(github.com/percona) |
| 105 | + exclusions: |
| 106 | + generated: lax |
| 107 | + paths: |
| 108 | + - pkg/generated |
| 109 | + - hack |
| 110 | + - third_party$ |
| 111 | + - builtin$ |
| 112 | + - examples$ |
0 commit comments