|
1 |
| -issues: |
2 |
| - # Excluding configuration per-path, per-linter, per-text and per-source |
3 |
| - exclude-rules: |
4 |
| - # Exclude some linters from running on tests files. |
5 |
| - - path: _test\.go |
6 |
| - linters: [gosec, bodyclose, noctx] |
7 |
| - |
8 |
| - - path: crossdock |
9 |
| - linters: [noctx] |
10 |
| - |
11 |
| - # See https://github.com/jaegertracing/jaeger/issues/4488 |
12 |
| - - path: internal/grpctest/ |
13 |
| - linters: [staticcheck] |
14 |
| - |
15 |
| - - linters: [gocritic] |
16 |
| - text: "dupArg" |
17 |
| - - linters: [gocritic] |
18 |
| - text: "exitAfterDefer" |
19 |
| - - linters: [gocritic] |
20 |
| - text: "appendAssign" |
21 |
| - exclude-dirs-use-default: false |
22 |
| - exclude-dirs: |
23 |
| - - mocks |
24 |
| - - thrift-0.9.2 |
25 |
| - - .*-gen |
26 |
| - exclude-files: |
27 |
| - - ".*.pb.go$" |
28 |
| - max-issues-per-linter: 0 |
29 |
| - max-same-issues: 0 |
30 |
| - |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + go: "1.23" |
31 | 4 | linters:
|
32 |
| - disable: |
33 |
| - - errcheck |
34 | 5 | enable:
|
35 |
| - # Plain ASCII identifiers. |
36 | 6 | - asciicheck
|
37 |
| - |
38 |
| - # Checks for dangerous unicode character sequences. |
39 | 7 | - bidichk
|
40 |
| - |
41 |
| - # Checks whether HTTP response body is closed successfully. |
42 |
| - # TODO enable this but maybe find a way to disable in tests. |
43 | 8 | - bodyclose
|
44 |
| - |
45 |
| - # Check whether the function uses a non-inherited context. |
46 | 9 | - contextcheck
|
47 |
| - |
48 |
| - # Check declaration order of types, consts, vars and funcs. |
| 10 | + - copyloopvar |
49 | 11 | - decorder
|
50 |
| - |
51 |
| - # Checks if package imports are in a list of acceptable packages (see cfg below). |
52 | 12 | - depguard
|
53 |
| - |
54 |
| - # Check for two durations multiplied together. |
55 | 13 | - durationcheck
|
56 |
| - |
57 |
| - # Checks `Err-` prefix for var and `-Error` suffix for error type. |
58 | 14 | - errname
|
59 |
| - |
60 |
| - # Suggests to use `%w` for error-wrapping. |
61 | 15 | - errorlint
|
62 |
| - |
63 |
| - # Checks for pointers to enclosing loop variables. |
64 |
| - - copyloopvar |
65 |
| - |
66 | 16 | - gocritic
|
67 |
| - - gofmt |
68 |
| - - gofumpt |
69 |
| - - goimports |
70 |
| - |
71 |
| - # Allow or ban replace directives in go.mod |
72 |
| - # or force explanation for retract directives. |
73 |
| - # Maybe enable once we get rid of old sarama. |
74 |
| - # - gomoddirectives |
75 |
| - |
76 | 17 | - gosec
|
77 |
| - |
78 |
| - # Linter that specializes in simplifying code. |
79 |
| - - gosimple |
80 |
| - - govet |
81 |
| - |
82 |
| - # Detects when assignments to existing variables are not used. |
83 |
| - - ineffassign |
84 |
| - |
85 | 18 | - misspell
|
86 |
| - |
87 |
| - # Finds naked/bare returns and requires change them. |
88 | 19 | - nakedret
|
89 |
| - |
90 |
| - # Require a bit more explicit returns. |
91 | 20 | - nilerr
|
92 |
| - |
93 |
| - # Finds sending HTTP request without context.Context. |
94 | 21 | - noctx
|
95 |
| - |
96 |
| - # Reports ill-formed or insufficient nolint directives. |
97 | 22 | - nolintlint
|
98 |
| - |
99 |
| - # Checks that fmt.Sprintf can be replaced with a faster alternative. |
100 | 23 | - perfsprint
|
101 |
| - |
102 |
| - # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. |
103 | 24 | - revive
|
104 |
| - |
105 |
| - # Checks usage of github.com/stretchr/testify. |
106 | 25 | - testifylint
|
107 |
| - |
108 |
| - # Detects the possibility to use variables/constants from the Go standard library. |
109 | 26 | - usestdlibvars
|
110 |
| - |
111 |
| - # TODO consider adding more linters, cf. https://olegk.dev/go-linters-configuration-the-right-version |
112 |
| - |
113 |
| -linters-settings: |
114 |
| - depguard: |
115 |
| - rules: |
116 |
| - disallowed-deps: |
117 |
| - deny: |
118 |
| - - pkg: go.uber.org/atomic |
119 |
| - desc: "Use 'sync/atomic' instead of go.uber.org/atomic" |
120 |
| - - pkg: io/ioutil |
121 |
| - desc: "Use os or io instead of io/ioutil" |
122 |
| - - pkg: github.com/hashicorp/go-multierror |
123 |
| - desc: "Use errors.Join instead of github.com/hashicorp/go-multierror" |
124 |
| - - pkg: go.uber.org/multierr |
125 |
| - desc: "Use errors.Join instead of github.com/hashicorp/go-multierror" |
126 |
| - - pkg: "github.com/jaegertracing/jaeger/model$" |
127 |
| - desc: "Use github.com/jaegertracing/jaeger-idl/model/v1" |
128 |
| - - pkg: "github.com/jaegertracing/jaeger/internal/proto-gen/api_v2$" |
129 |
| - desc: "Use github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" |
130 |
| - # crossdock-go provides assert/require similar to stretchr/testify |
131 |
| - # but we never want to use them outside of the crossdock tests. |
132 |
| - disallow-crossdock: |
133 |
| - deny: |
134 |
| - - pkg: github.com/crossdock/crossdock-go |
135 |
| - desc: "Do not refer to crossdock from other packages" |
136 |
| - files: |
137 |
| - - "!**/crossdock/**" |
138 |
| - |
139 |
| - disallow-uber/goleak: |
140 |
| - deny: |
141 |
| - - pkg: go.uber.org/goleak |
142 |
| - desc: "Use github.com/jaegertracing/jaeger/internal/testutils" |
143 |
| - files: |
144 |
| - - "**_test.go" |
145 |
| - |
146 |
| - disallow-otel-contrib-translator: |
147 |
| - deny: |
148 |
| - - pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger |
149 |
| - desc: "Use v1adapter package instead of opentelemetry-collector-contrib/pkg/translator/jaeger" |
150 |
| - files: |
151 |
| - - "!**/v1adapter/**" |
152 |
| - |
153 |
| - goimports: |
154 |
| - local-prefixes: github.com/jaegertracing/jaeger |
155 |
| - gosec: |
156 |
| - # To specify a set of rules to explicitly exclude. |
157 |
| - # Available rules: https://github.com/securego/gosec#available-rules |
158 |
| - excludes: |
159 |
| - - G104 |
160 |
| - - G107 |
161 |
| - - G404 |
162 |
| - - G601 |
163 |
| - govet: |
164 |
| - enable-all: true |
165 |
| - disable: |
166 |
| - # There is rarely performance differences due to padding, |
167 |
| - # the most noticable impact is memory usage. However, |
168 |
| - # the main trace data is Protobuf-generated and we ignore |
169 |
| - # those files from linting, so this linter is not useful. |
170 |
| - - fieldalignment |
171 |
| - # Disable shadow |
172 |
| - - shadow |
173 |
| - perfsprint: |
174 |
| - # Optimizes even if it requires an int or uint type cast. |
175 |
| - int-conversion: true |
176 |
| - # Optimizes into `err.Error()` even if it is only equivalent for non-nil errors. |
177 |
| - err-error: true |
178 |
| - # Optimizes `fmt.Errorf`. |
179 |
| - errorf: true |
180 |
| - # Optimizes `fmt.Sprintf` with only one argument. |
181 |
| - sprintf1: true |
182 |
| - # Optimizes into strings concatenation. |
183 |
| - strconcat: true |
184 |
| - revive: |
185 |
| - ignore-generated-header: true |
| 27 | + disable: |
| 28 | + - errcheck |
| 29 | + - staticcheck |
| 30 | + settings: |
| 31 | + depguard: |
| 32 | + rules: |
| 33 | + disallow-crossdock: |
| 34 | + files: |
| 35 | + - '!**/crossdock/**' |
| 36 | + deny: |
| 37 | + - pkg: github.com/crossdock/crossdock-go |
| 38 | + desc: Do not refer to crossdock from other packages |
| 39 | + disallow-otel-contrib-translator: |
| 40 | + files: |
| 41 | + - '!**/v1adapter/**' |
| 42 | + deny: |
| 43 | + - pkg: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger |
| 44 | + desc: Use v1adapter package instead of opentelemetry-collector-contrib/pkg/translator/jaeger |
| 45 | + disallow-uber/goleak: |
| 46 | + files: |
| 47 | + - '**_test.go' |
| 48 | + deny: |
| 49 | + - pkg: go.uber.org/goleak |
| 50 | + desc: Use github.com/jaegertracing/jaeger/internal/testutils |
| 51 | + disallowed-deps: |
| 52 | + deny: |
| 53 | + - pkg: go.uber.org/atomic |
| 54 | + desc: Use 'sync/atomic' instead of go.uber.org/atomic |
| 55 | + - pkg: io/ioutil |
| 56 | + desc: Use os or io instead of io/ioutil |
| 57 | + - pkg: github.com/hashicorp/go-multierror |
| 58 | + desc: Use errors.Join instead of github.com/hashicorp/go-multierror |
| 59 | + - pkg: go.uber.org/multierr |
| 60 | + desc: Use errors.Join instead of github.com/hashicorp/go-multierror |
| 61 | + - pkg: github.com/jaegertracing/jaeger/model$ |
| 62 | + desc: Use github.com/jaegertracing/jaeger-idl/model/v1 |
| 63 | + - pkg: github.com/jaegertracing/jaeger/internal/proto-gen/api_v2$ |
| 64 | + desc: Use github.com/jaegertracing/jaeger-idl/proto-gen/api_v2 |
| 65 | + gosec: |
| 66 | + excludes: |
| 67 | + - G104 |
| 68 | + - G107 |
| 69 | + - G404 |
| 70 | + - G601 |
| 71 | + govet: |
| 72 | + disable: |
| 73 | + - fieldalignment |
| 74 | + - shadow |
| 75 | + enable-all: true |
| 76 | + perfsprint: |
| 77 | + int-conversion: true |
| 78 | + err-error: true |
| 79 | + errorf: true |
| 80 | + sprintf1: true |
| 81 | + strconcat: true |
| 82 | + revive: |
186 | 83 | severity: error
|
187 | 84 | enable-all-rules: true
|
188 |
| - # See https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md |
189 | 85 | rules:
|
190 | 86 | # not a completely bad linter, but needs clean-up and sensible width (80 is too small)
|
191 | 87 | - name: line-length-limit
|
| 88 | + arguments: |
| 89 | + - 80 |
192 | 90 | disabled: true
|
193 |
| - arguments: [80] |
194 | 91 | # would be ok if we could exclude the test files, but otherwise too noisy
|
195 | 92 | - name: add-constant
|
196 | 93 | disabled: true
|
@@ -245,9 +142,57 @@ linters-settings:
|
245 | 142 | # this rule conflicts with nolintlint which does insist on no-space in //nolint
|
246 | 143 | - name: comment-spacings
|
247 | 144 | disabled: true
|
248 |
| - testifylint: |
249 |
| - enable-all: true |
250 |
| - |
251 |
| -run: |
252 |
| - go: "1.23" |
253 |
| - timeout: 20m |
| 145 | + testifylint: |
| 146 | + enable-all: true |
| 147 | + exclusions: |
| 148 | + generated: lax |
| 149 | + presets: |
| 150 | + - comments |
| 151 | + - common-false-positives |
| 152 | + - legacy |
| 153 | + - std-error-handling |
| 154 | + rules: |
| 155 | + - linters: |
| 156 | + - bodyclose |
| 157 | + - gosec |
| 158 | + - noctx |
| 159 | + path: _test\.go |
| 160 | + - linters: |
| 161 | + - noctx |
| 162 | + path: crossdock |
| 163 | + - linters: |
| 164 | + - staticcheck |
| 165 | + path: internal/grpctest/ |
| 166 | + - linters: |
| 167 | + - gocritic |
| 168 | + text: dupArg |
| 169 | + - linters: |
| 170 | + - gocritic |
| 171 | + text: exitAfterDefer |
| 172 | + - linters: |
| 173 | + - gocritic |
| 174 | + text: appendAssign |
| 175 | + paths: |
| 176 | + - .*.pb.go$ |
| 177 | + - mocks |
| 178 | + - thrift-0.9.2 |
| 179 | + - .*-gen |
| 180 | +issues: |
| 181 | + max-issues-per-linter: 0 |
| 182 | + max-same-issues: 0 |
| 183 | +formatters: |
| 184 | + enable: |
| 185 | + - gofmt |
| 186 | + - gofumpt |
| 187 | + - goimports |
| 188 | + settings: |
| 189 | + goimports: |
| 190 | + local-prefixes: |
| 191 | + - github.com/jaegertracing/jaeger |
| 192 | + exclusions: |
| 193 | + generated: lax |
| 194 | + paths: |
| 195 | + - .*.pb.go$ |
| 196 | + - mocks |
| 197 | + - thrift-0.9.2 |
| 198 | + - .*-gen |
0 commit comments