|
1 | | -linters-settings: |
2 | | - depguard: |
3 | | - # new configuration |
4 | | - rules: |
5 | | - logger: |
6 | | - deny: |
7 | | - # logging is allowed only by logutils.Log, |
8 | | - # logrus is allowed to use only in logutils package. |
9 | | - - pkg: "github.com/sirupsen/logrus" |
10 | | - desc: logging is allowed only by logutils.Log |
11 | | - dupl: |
12 | | - threshold: 100 |
13 | | - funlen: |
14 | | - lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner. |
15 | | - statements: 80 |
16 | | - goconst: |
17 | | - min-len: 2 |
18 | | - min-occurrences: 3 |
19 | | - gocritic: |
20 | | - enabled-tags: |
21 | | - - diagnostic |
22 | | - - experimental |
23 | | - - opinionated |
24 | | - - performance |
25 | | - - style |
26 | | - disabled-checks: |
27 | | - - dupImport # https://github.com/go-critic/go-critic/issues/845 |
28 | | - - ifElseChain |
29 | | - - octalLiteral |
30 | | - - whyNoLint |
31 | | - gocyclo: |
32 | | - min-complexity: 45 |
33 | | - gofmt: |
34 | | - rewrite-rules: |
35 | | - - pattern: 'interface{}' |
36 | | - replacement: 'any' |
37 | | - goimports: |
38 | | - local-prefixes: github.com/golangci/golangci-lint |
39 | | - mnd: |
40 | | - # don't include the "operation" and "assign" |
41 | | - checks: |
42 | | - - argument |
43 | | - - case |
44 | | - - condition |
45 | | - - return |
46 | | - ignored-numbers: |
47 | | - - '0' |
48 | | - - '1' |
49 | | - - '2' |
50 | | - - '3' |
51 | | - ignored-functions: |
52 | | - - strings.SplitN |
53 | | - govet: |
54 | | - settings: |
55 | | - printf: |
56 | | - funcs: |
57 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
58 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
59 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
60 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
61 | | - lll: |
62 | | - line-length: 215 |
63 | | - misspell: |
64 | | - locale: US |
65 | | - nolintlint: |
66 | | - # https://www.github.com/golangci/golangci-lint/issues/3228 |
67 | | - allow-unused: true # report any unused nolint directives |
68 | | - require-explanation: false # don't require an explanation for nolint directives |
69 | | - require-specific: false # don't require nolint directives to be specific about which linter is being skipped |
70 | | - revive: |
71 | | - rules: |
72 | | - - name: unexported-return |
73 | | - disabled: true |
74 | | - - name: unused-parameter |
75 | | - |
| 1 | +version: "2" |
76 | 2 | linters: |
77 | | - disable-all: true |
| 3 | + default: none |
78 | 4 | enable: |
79 | 5 | - asasalint |
80 | 6 | - asciicheck |
81 | 7 | - bidichk |
82 | 8 | - bodyclose |
83 | 9 | - containedctx |
84 | | - #- contextcheck |
85 | 10 | - depguard |
86 | 11 | - dogsled |
87 | 12 | - dupl |
88 | 13 | - durationcheck |
89 | 14 | - errcheck |
90 | | - # - exportloopref deprecated by go1.22 and with 1.60.2 |
91 | 15 | - funlen |
92 | 16 | - ginkgolinter |
93 | 17 | - gocheckcompilerdirectives |
94 | | - # - gochecknoinits |
95 | 18 | - goconst |
96 | 19 | - gocritic |
97 | 20 | - gocyclo |
98 | | - - gofmt |
99 | | - - goimports |
100 | | - - mnd |
101 | 21 | - gomodguard |
102 | 22 | - goprintffuncname |
103 | 23 | - gosec |
104 | | - - gosimple |
105 | 24 | - govet |
106 | 25 | - importas |
107 | 26 | - ineffassign |
108 | 27 | - lll |
109 | 28 | - misspell |
| 29 | + - mnd |
110 | 30 | - nakedret |
111 | 31 | - noctx |
112 | 32 | - nolintlint |
113 | 33 | - revive |
114 | 34 | - sloglint |
115 | 35 | - staticcheck |
116 | | - # - stylecheck |
117 | | - - typecheck |
118 | 36 | - unconvert |
119 | 37 | - unparam |
120 | 38 | - unused |
121 | 39 | - whitespace |
122 | | - #- wsl |
123 | 40 | - zerologlint |
124 | | - |
125 | | - # don't enable: |
126 | | - # - asciicheck |
127 | | - # - scopelint |
128 | | - # - gochecknoglobals |
129 | | - # - gocognit |
130 | | - # - godot |
131 | | - # - godox |
132 | | - # - goerr113 |
133 | | - # - interfacer |
134 | | - # - maligned |
135 | | - # - nestif |
136 | | - # - prealloc |
137 | | - # - testpackage |
138 | | - # - wsl |
139 | | - |
140 | | -issues: |
141 | | - # Excluding configuration per-path, per-linter, per-text and per-source |
142 | | - exclude-rules: |
143 | | - - path: _test\.go |
144 | | - linters: |
145 | | - - mnd |
146 | | - |
147 | | - - path: pkg/golinters/errcheck.go |
148 | | - text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead" |
149 | | - - path: pkg/commands/run.go |
150 | | - text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead" |
151 | | - - path: pkg/commands/run.go |
152 | | - text: "SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used." |
153 | | - |
154 | | - - path: pkg/golinters/gofumpt.go |
155 | | - text: "SA1019: settings.LangVersion is deprecated: use the global `run.go` instead." |
156 | | - - path: pkg/golinters/staticcheck_common.go |
157 | | - text: "SA1019: settings.GoVersion is deprecated: use the global `run.go` instead." |
158 | | - - path: pkg/lint/lintersdb/manager.go |
159 | | - text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead." |
160 | | - - path: pkg/golinters/unused.go |
161 | | - text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)" |
162 | | - - path: test/(fix|linters)_test.go |
163 | | - text: "string `gocritic.go` has 3 occurrences, make it a constant" |
164 | | - exclude-dirs: |
165 | | - - test/testdata_etc # test files |
166 | | - - internal/cache # extracted from Go code |
167 | | - - internal/renameio # extracted from Go code |
168 | | - - internal/robustio # extracted from Go code |
169 | | - |
170 | | -run: |
171 | | - timeout: 5m |
| 41 | + settings: |
| 42 | + depguard: |
| 43 | + rules: |
| 44 | + logger: |
| 45 | + deny: |
| 46 | + - pkg: github.com/sirupsen/logrus |
| 47 | + desc: logging is allowed only by logutils.Log |
| 48 | + dupl: |
| 49 | + threshold: 100 |
| 50 | + funlen: |
| 51 | + lines: -1 |
| 52 | + statements: 80 |
| 53 | + goconst: |
| 54 | + min-len: 2 |
| 55 | + min-occurrences: 3 |
| 56 | + gocritic: |
| 57 | + disabled-checks: |
| 58 | + - dupImport |
| 59 | + - ifElseChain |
| 60 | + - octalLiteral |
| 61 | + - whyNoLint |
| 62 | + enabled-tags: |
| 63 | + - diagnostic |
| 64 | + - experimental |
| 65 | + - opinionated |
| 66 | + - performance |
| 67 | + - style |
| 68 | + gocyclo: |
| 69 | + min-complexity: 45 |
| 70 | + govet: |
| 71 | + settings: |
| 72 | + printf: |
| 73 | + funcs: |
| 74 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
| 75 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
| 76 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
| 77 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
| 78 | + lll: |
| 79 | + line-length: 215 |
| 80 | + misspell: |
| 81 | + locale: US |
| 82 | + mnd: |
| 83 | + checks: |
| 84 | + - argument |
| 85 | + - case |
| 86 | + - condition |
| 87 | + - return |
| 88 | + ignored-numbers: |
| 89 | + - "0" |
| 90 | + - "1" |
| 91 | + - "2" |
| 92 | + - "3" |
| 93 | + ignored-functions: |
| 94 | + - strings.SplitN |
| 95 | + nolintlint: |
| 96 | + require-explanation: false |
| 97 | + require-specific: false |
| 98 | + allow-unused: true |
| 99 | + revive: |
| 100 | + rules: |
| 101 | + - name: unexported-return |
| 102 | + disabled: true |
| 103 | + - name: unused-parameter |
| 104 | + exclusions: |
| 105 | + generated: lax |
| 106 | + presets: |
| 107 | + - comments |
| 108 | + - common-false-positives |
| 109 | + - legacy |
| 110 | + - std-error-handling |
| 111 | + rules: |
| 112 | + - linters: |
| 113 | + - lll |
| 114 | + source: ".*operator-sdk:csv:customresourcedefinitions" |
| 115 | + - linters: |
| 116 | + - goconst |
| 117 | + - gocritic |
| 118 | + - ineffassign |
| 119 | + - mnd |
| 120 | + - revive |
| 121 | + - staticcheck |
| 122 | + path: _test\.go |
| 123 | + - path: pkg/golinters/errcheck.go |
| 124 | + text: 'SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead' |
| 125 | + - path: pkg/commands/run.go |
| 126 | + text: 'SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead' |
| 127 | + - path: pkg/commands/run.go |
| 128 | + text: 'SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used.' |
| 129 | + - path: pkg/golinters/gofumpt.go |
| 130 | + text: 'SA1019: settings.LangVersion is deprecated: use the global `run.go` instead.' |
| 131 | + - path: pkg/golinters/staticcheck_common.go |
| 132 | + text: 'SA1019: settings.GoVersion is deprecated: use the global `run.go` instead.' |
| 133 | + - path: pkg/lint/lintersdb/manager.go |
| 134 | + text: 'SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead.' |
| 135 | + - path: pkg/golinters/unused.go |
| 136 | + text: 'rangeValCopy: each iteration copies 160 bytes \(consider pointers or indexing\)' |
| 137 | + - path: test/(fix|linters)_test.go |
| 138 | + text: string `gocritic.go` has 3 occurrences, make it a constant |
| 139 | + paths: |
| 140 | + - test/testdata_etc |
| 141 | + - internal/cache |
| 142 | + - internal/renameio |
| 143 | + - internal/robustio |
| 144 | + - third_party$ |
| 145 | + - builtin$ |
| 146 | + - examples$ |
| 147 | +formatters: |
| 148 | + enable: |
| 149 | + - gofmt |
| 150 | + - goimports |
| 151 | + settings: |
| 152 | + gofmt: |
| 153 | + rewrite-rules: |
| 154 | + - pattern: interface{} |
| 155 | + replacement: any |
| 156 | + goimports: |
| 157 | + local-prefixes: |
| 158 | + - github.com/golangci/golangci-lint |
| 159 | + exclusions: |
| 160 | + generated: lax |
| 161 | + paths: |
| 162 | + - test/testdata_etc |
| 163 | + - internal/cache |
| 164 | + - internal/renameio |
| 165 | + - internal/robustio |
| 166 | + - third_party$ |
| 167 | + - builtin$ |
| 168 | + - examples$ |
0 commit comments