| 1 |
|
| 2 |
version: "2" |
| 3 |
linters: |
| 4 |
default: all |
| 5 |
disable: |
| 6 |
- containedctx |
| 7 |
- contextcheck |
| 8 |
- cyclop |
| 9 |
- dogsled |
| 10 |
- dupl |
| 11 |
- forcetypeassert |
| 12 |
- gocyclo |
| 13 |
- gomodguard |
| 14 |
- interfacebloat |
| 15 |
- ireturn |
| 16 |
- lll |
| 17 |
- nlreturn |
| 18 |
- nonamedreturns |
| 19 |
- perfsprint |
| 20 |
- varnamelen |
| 21 |
- wrapcheck |
| 22 |
- wsl |
| 23 |
- wsl_v5 |
| 24 |
settings: |
| 25 |
decorder: |
| 26 |
disable-init-func-first-check: false |
| 27 |
depguard: |
| 28 |
rules: |
| 29 |
main: |
| 30 |
deny: |
| 31 |
- pkg: math/rand$ |
| 32 |
desc: use math/rand/v2 |
| 33 |
- pkg: github.com/prometheus/common/log |
| 34 |
desc: Should be replaced by standard lib log/slog package |
| 35 |
- pkg: github.com/sirupsen/logrus |
| 36 |
desc: Should be replaced by standard lib log/slog package |
| 37 |
- pkg: github.com/go-errors/errors |
| 38 |
desc: Should be replaced by standard lib errors package |
| 39 |
- pkg: github.com/pkg/errors |
| 40 |
desc: Should be replaced by standard lib errors package |
| 41 |
- pkg: github.com/prometheus/client_golang/prometheus/promauto |
| 42 |
desc: Not allowed because it uses global variables |
| 43 |
- pkg: github.com/golang/protobuf |
| 44 |
desc: Should be replaced by google.golang.org/protobuf package |
| 45 |
- pkg: github.com/grpc-ecosystem/go-grpc-middleware$ |
| 46 |
desc: Should be replaced by github.com/grpc-ecosystem/go-grpc-middleware/v2 |
| 47 |
- pkg: github.com/grpc-ecosystem/go-grpc-prometheus |
| 48 |
desc: Should be replaced by github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus |
| 49 |
dupl: |
| 50 |
threshold: 100 |
| 51 |
embeddedstructfieldcheck: |
| 52 |
forbid-mutex: true |
| 53 |
errcheck: |
| 54 |
exclude-functions: |
| 55 |
- encoding/json.Marshal |
| 56 |
- encoding/json.MarshalIndent |
| 57 |
errchkjson: |
| 58 |
check-error-free-encoding: true |
| 59 |
report-no-exported: true |
| 60 |
exhaustive: |
| 61 |
check: |
| 62 |
- switch |
| 63 |
- map |
| 64 |
explicit-exhaustive-map: true |
| 65 |
exhaustruct: |
| 66 |
include: |
| 67 |
- ^$ |
| 68 |
fatcontext: |
| 69 |
check-struct-pointers: true |
| 70 |
forbidigo: |
| 71 |
forbid: |
| 72 |
- pattern: ^print(ln)?$ |
| 73 |
exclude-godoc-examples: false |
| 74 |
analyze-types: true |
| 75 |
funcorder: |
| 76 |
struct-method: false |
| 77 |
gochecksumtype: |
| 78 |
default-signifies-exhaustive: false |
| 79 |
include-shared-interfaces: true |
| 80 |
gocognit: |
| 81 |
min-complexity: 20 |
| 82 |
gocritic: |
| 83 |
enable-all: true |
| 84 |
disabled-checks: |
| 85 |
- exposedSyncMutex |
| 86 |
- hugeParam |
| 87 |
- paramTypeCombine |
| 88 |
- switchTrue |
| 89 |
- todoCommentWithoutDetail |
| 90 |
- yodaStyleExpr |
| 91 |
settings: |
| 92 |
captLocal: |
| 93 |
paramsOnly: false |
| 94 |
ruleguard: |
| 95 |
failOn: all |
| 96 |
truncateCmp: |
| 97 |
skipArchDependent: false |
| 98 |
underef: |
| 99 |
skipRecvDeref: false |
| 100 |
unnamedResult: |
| 101 |
checkExported: true |
| 102 |
godoclint: |
| 103 |
default: all |
| 104 |
options: |
| 105 |
max-len: |
| 106 |
length: 97 |
| 107 |
godot: |
| 108 |
exclude: |
| 109 |
- :$ |
| 110 |
- '^\s*- ' |
| 111 |
godox: |
| 112 |
keywords: |
| 113 |
- BUG |
| 114 |
- FIXME |
| 115 |
- DEBUG |
| 116 |
gomodguard_v2: |
| 117 |
blocked: |
| 118 |
- module: github.com/cenkalti/backoff |
| 119 |
version: < 4.0.0 |
| 120 |
reason: use actual version |
| 121 |
gosec: |
| 122 |
excludes: |
| 123 |
- G104 |
| 124 |
config: |
| 125 |
global: |
| 126 |
audit: true |
| 127 |
govet: |
| 128 |
enable-all: true |
| 129 |
disable: |
| 130 |
- fieldalignment |
| 131 |
settings: |
| 132 |
shadow: |
| 133 |
strict: true |
| 134 |
grouper: |
| 135 |
import-require-single-import: true |
| 136 |
iface: |
| 137 |
enable: |
| 138 |
- identical |
| 139 |
- unused |
| 140 |
- opaque |
| 141 |
- unexported |
| 142 |
importas: |
| 143 |
alias: |
| 144 |
- pkg: errors |
| 145 |
alias: "" |
| 146 |
- pkg: net/url |
| 147 |
alias: urlpkg |
| 148 |
loggercheck: |
| 149 |
require-string-key: true |
| 150 |
no-printf-like: true |
| 151 |
misspell: |
| 152 |
mode: restricted |
| 153 |
nestif: |
| 154 |
min-complexity: 4 |
| 155 |
nilnil: |
| 156 |
detect-opposite: true |
| 157 |
nolintlint: |
| 158 |
require-explanation: true |
| 159 |
require-specific: true |
| 160 |
paralleltest: |
| 161 |
check-cleanup: true |
| 162 |
reassign: |
| 163 |
patterns: |
| 164 |
- .* |
| 165 |
revive: |
| 166 |
rules: |
| 167 |
- name: add-constant |
| 168 |
disabled: true |
| 169 |
- name: argument-limit |
| 170 |
disabled: true |
| 171 |
- name: atomic |
| 172 |
- name: banned-characters |
| 173 |
arguments: [] " ] |
| 174 |
- name: bare-return |
| 175 |
disabled: true |
| 176 |
- name: blank-imports |
| 177 |
- name: bool-literal-in-expr |
| 178 |
- name: call-to-gc |
| 179 |
- name: cognitive-complexity |
| 180 |
disabled: true |
| 181 |
- name: comment-spacings |
| 182 |
arguments: |
| 183 |
- nolint |
| 184 |
- name: comments-density |
| 185 |
disabled: true |
| 186 |
- name: confusing-naming |
| 187 |
disabled: true |
| 188 |
- name: confusing-results |
| 189 |
- name: constant-logical-expr |
| 190 |
- name: context-as-argument |
| 191 |
arguments: |
| 192 |
- allowTypesBefore: '*testing.T,*check.C' |
| 193 |
- name: context-keys-type |
| 194 |
- name: cyclomatic |
| 195 |
disabled: true |
| 196 |
- name: datarace |
| 197 |
- name: deep-exit |
| 198 |
- name: defer |
| 199 |
- name: dot-imports |
| 200 |
- name: duplicated-imports |
| 201 |
- name: early-return |
| 202 |
- name: empty-block |
| 203 |
disabled: true |
| 204 |
- name: empty-lines |
| 205 |
- name: enforce-map-style |
| 206 |
arguments: |
| 207 |
- make |
| 208 |
- name: enforce-repeated-arg-type-style |
| 209 |
disabled: true |
| 210 |
- name: enforce-slice-style |
| 211 |
disabled: true |
| 212 |
- name: enforce-switch-style |
| 213 |
arguments: |
| 214 |
- allowNoDefault |
| 215 |
- name: epoch-naming |
| 216 |
- name: error-naming |
| 217 |
- name: error-return |
| 218 |
- name: error-strings |
| 219 |
- name: errorf |
| 220 |
- name: exported |
| 221 |
disabled: true |
| 222 |
- name: file-header |
| 223 |
- name: file-length-limit |
| 224 |
- name: filename-format |
| 225 |
- name: flag-parameter |
| 226 |
- name: forbidden-call-in-wg-go |
| 227 |
- name: function-length |
| 228 |
disabled: true |
| 229 |
- name: function-result-limit |
| 230 |
disabled: true |
| 231 |
- name: get-return |
| 232 |
- name: identical-branches |
| 233 |
- name: identical-ifelseif-branches |
| 234 |
- name: identical-ifelseif-conditions |
| 235 |
- name: identical-switch-branches |
| 236 |
- name: identical-switch-conditions |
| 237 |
- name: if-return |
| 238 |
- name: import-alias-naming |
| 239 |
- name: import-shadowing |
| 240 |
- name: imports-blocklist |
| 241 |
- name: increment-decrement |
| 242 |
- name: indent-error-flow |
| 243 |
- name: inefficient-map-lookup |
| 244 |
- name: line-length-limit |
| 245 |
disabled: true |
| 246 |
- name: max-control-nesting |
| 247 |
- name: max-public-structs |
| 248 |
disabled: true |
| 249 |
- name: modifies-parameter |
| 250 |
- name: modifies-value-receiver |
| 251 |
- name: nested-structs |
| 252 |
disabled: true |
| 253 |
- name: optimize-operands-order |
| 254 |
- name: package-comments |
| 255 |
- name: package-directory-mismatch |
| 256 |
- name: package-naming |
| 257 |
- name: range |
| 258 |
- name: range-val-address |
| 259 |
- name: range-val-in-closure |
| 260 |
- name: receiver-naming |
| 261 |
- name: redefines-builtin-id |
| 262 |
- name: redundant-build-tag |
| 263 |
- name: redundant-import-alias |
| 264 |
- name: redundant-test-main-exit |
| 265 |
- name: string-format |
| 266 |
arguments: |
| 267 |
- - fmt.Errorf[0] |
| 268 |
- /(^|[^\.!?])$/ |
| 269 |
- must not end in punctuation |
| 270 |
- - panic |
| 271 |
- /^[^\n]*$/ |
| 272 |
- must not contain line breaks |
| 273 |
- name: string-of-int |
| 274 |
- name: struct-tag |
| 275 |
- name: superfluous-else |
| 276 |
- name: time-date |
| 277 |
- name: time-equal |
| 278 |
- name: time-naming |
| 279 |
- name: unchecked-type-assertion |
| 280 |
disabled: true |
| 281 |
- name: unconditional-recursion |
| 282 |
- name: unexported-naming |
| 283 |
- name: unexported-return |
| 284 |
- name: unhandled-error |
| 285 |
disabled: true |
| 286 |
- name: unnecessary-format |
| 287 |
- name: unnecessary-if |
| 288 |
- name: unnecessary-stmt |
| 289 |
- name: unreachable-code |
| 290 |
- name: use-slices-sort |
| 291 |
- name: unsecure-url-scheme |
| 292 |
- name: unused-parameter |
| 293 |
- name: unused-receiver |
| 294 |
- name: use-any |
| 295 |
- name: use-errors-new |
| 296 |
- name: use-fmt-print |
| 297 |
- name: use-slices-sort |
| 298 |
- name: use-waitgroup-go |
| 299 |
- name: useless-break |
| 300 |
- name: useless-fallthrough |
| 301 |
- name: var-declaration |
| 302 |
- name: var-naming |
| 303 |
- name: waitgroup-by-value |
| 304 |
rowserrcheck: |
| 305 |
packages: |
| 306 |
- github.com/jmoiron/sqlx |
| 307 |
- github.com/powerman/sqlxx |
| 308 |
sloglint: |
| 309 |
context: scope |
| 310 |
static-msg: true |
| 311 |
msg-style: capitalized |
| 312 |
forbidden-keys: |
| 313 |
- time |
| 314 |
- level |
| 315 |
- msg |
| 316 |
- source |
| 317 |
key-naming-case: snake |
| 318 |
tagalign: |
| 319 |
order: |
| 320 |
- json |
| 321 |
- yaml |
| 322 |
- yml |
| 323 |
- toml |
| 324 |
- cmd |
| 325 |
- arg |
| 326 |
- embed |
| 327 |
- hidden |
| 328 |
- passthrough |
| 329 |
- optional |
| 330 |
- required |
| 331 |
- default |
| 332 |
- envprefix |
| 333 |
- env |
| 334 |
- name |
| 335 |
- enum |
| 336 |
- help |
| 337 |
- mod |
| 338 |
- mapstructure |
| 339 |
- binding |
| 340 |
- mold |
| 341 |
- validate |
| 342 |
strict: true |
| 343 |
tagliatelle: |
| 344 |
case: |
| 345 |
rules: |
| 346 |
json: snake |
| 347 |
yaml: kebab |
| 348 |
xml: camel |
| 349 |
toml: camel |
| 350 |
bson: camel |
| 351 |
avro: snake |
| 352 |
mapstructure: kebab |
| 353 |
envconfig: upperSnake |
| 354 |
whatever: snake |
| 355 |
testifylint: |
| 356 |
enable-all: true |
| 357 |
testpackage: |
| 358 |
skip-regexp: .*_internal_test\.go |
| 359 |
thelper: |
| 360 |
test: |
| 361 |
name: false |
| 362 |
usestdlibvars: |
| 363 |
time-date-month: true |
| 364 |
time-month: true |
| 365 |
time-layout: true |
| 366 |
crypto-hash: true |
| 367 |
default-rpc-path: true |
| 368 |
sql-isolation-level: true |
| 369 |
tls-signature-scheme: true |
| 370 |
wrapcheck: |
| 371 |
report-internal-errors: true |
| 372 |
exclusions: |
| 373 |
rules: |
| 374 |
- linters: |
| 375 |
- govet |
| 376 |
text: declaration of "(log|err|ctx)" shadows |
| 377 |
- path: _test\.go|testing(_.*)?\.go |
| 378 |
linters: |
| 379 |
- bodyclose |
| 380 |
- dupl |
| 381 |
- errcheck |
| 382 |
- fatcontext |
| 383 |
- forcetypeassert |
| 384 |
- funlen |
| 385 |
- gochecknoglobals |
| 386 |
- gochecknoinits |
| 387 |
- gocognit |
| 388 |
- goconst |
| 389 |
- godoclint |
| 390 |
- gosec |
| 391 |
- maintidx |
| 392 |
- reassign |
| 393 |
- path: _test\.go|testing(_.*)?\.go |
| 394 |
text: (unnamedResult|exitAfterDefer|rangeValCopy|unnecessaryBlock) |
| 395 |
linters: |
| 396 |
- gocritic |
| 397 |
- path: _test\.go |
| 398 |
text: '"t" shadows' |
| 399 |
linters: |
| 400 |
- govet |
| 401 |
- path: ^(.*/)?embed.go$ |
| 402 |
linters: |
| 403 |
- gochecknoglobals |
| 404 |
- source: '[Cc]onst' |
| 405 |
linters: |
| 406 |
- gochecknoglobals |
| 407 |
- linters: |
| 408 |
- lll |
| 409 |
source: '^//go:generate ' |
| 410 |
- linters: |
| 411 |
- staticcheck |
| 412 |
text: 'SA5008: duplicate struct tag "set"' |
| 413 |
- linters: |
| 414 |
- godoclint |
| 415 |
text: should have a godoc \("(String|Error|Format|(Marshal|Unmarshal)(Text|JSON))"\) |
| 416 |
paths: |
| 417 |
- \.[\w-]+\.go$ |
| 418 |
- internal/spew/ |
| 419 |
- internal/difflib/ |
| 420 |
- internal/deepequal/ |
| 421 |
formatters: |
| 422 |
enable: |
| 423 |
- gci |
| 424 |
- gofmt |
| 425 |
- gofumpt |
| 426 |
- goimports |
| 427 |
- golines |
| 428 |
settings: |
| 429 |
gci: |
| 430 |
sections: |
| 431 |
- standard |
| 432 |
- default |
| 433 |
- localmodule |
| 434 |
no-inline-comments: true |
| 435 |
no-prefix-comments: true |
| 436 |
gofmt: |
| 437 |
rewrite-rules: |
| 438 |
- pattern: interface{} |
| 439 |
replacement: any |
| 440 |
- pattern: a[b:len(a)] |
| 441 |
replacement: a[b:] |
| 442 |
golines: |
| 443 |
max-len: 200 |
| 444 |
tab-len: 8 |
| 445 |
reformat-tags: false |
| 446 |
exclusions: |
| 447 |
generated: strict |
| 448 |
paths: |
| 449 |
- \.[\w-]+\.go$ |
| 450 |
- internal/spew/ |
| 451 |
- internal/difflib/ |
| 452 |
- internal/deepequal/ |
| 453 |
issues: |
| 454 |
max-issues-per-linter: 0 |
| 455 |
max-same-issues: 0 |
| 456 |
output: |
| 457 |
sort-order: |
| 458 |
- linter |
| 459 |
- severity |
| 460 |
- file |
| 461 |
show-stats: false |
| 462 |
run: |
| 463 |
timeout: 1m |
| 464 |
modules-download-mode: readonly |
| 465 |
severity: |
| 466 |
default: error |