Files
releases/.golangci.yaml
T
Anders Eknert e03ac2f200 Bump golangci-lint, more gocritic linters (#8052)
- Bump golangci-lint -> 2.6.2
- Fix all `deprecatedComment` "notices should be in a dedicated paragraph, separated from the rest" reports
- Enable `appendCombine` and fix all "appendCombine: can combine chain of X appends into one" notices
- Enable `preferFprint` and fix the few reported issues
- Fix various issues reported only once or twice, like `zeroByteRepeat`

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
2025-11-17 11:08:39 +01:00

247 lines
5.4 KiB
YAML

version: "2"
run:
timeout: 5m
linters:
default: none
enable:
- copyloopvar
- errcheck
- gocritic
- govet
- ineffassign
- intrange
- mirror
- misspell
- perfsprint
- prealloc
- revive # replacement for golint
- staticcheck
- unconvert
- unused
- usetesting
# - gosec # too many false positives
settings:
gocritic:
enabled-checks:
# NOTE that these are rules enabled in addition to the default set
- filepathJoin
- dupImport
- redundantSprint
- stringConcatSimplify
disabled-checks:
- appendAssign
# NOTE(ae): this one should be enabled, but there were too
# many violations to fix in one go... revisit later
- singleCaseSwitch
# Reasonable rule, but not sure what to replace with in
# many locations, so disabling for now
- exitAfterDefer
# This is disabled from the perfomance tag enabled further down.
- hugeParam
enabled-tags:
- performance
settings:
ifElseChain:
# ridiculous value set for now, but this should be
# lowered to something more reasonable, as the rule
# is reasonable (replace long if-else chains with
# switch)... just too many violations right now
minThreshold: 10
govet:
disable:
# enable later and fix
- buildtag
enable:
- deepequalerrors
- nilness
lll:
line-length: 200
perfsprint:
# only rule disabled by default, but it's a good one
err-error: true
revive:
# this mainly complains about us using min/max for variable names,
# which seems like an unlikely source of actual issues
rules:
- name: redefines-builtin-id
disabled: true
- name: unused-receiver
disabled: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- staticcheck
path: ast/
text: SA1019
- linters:
- staticcheck
path: bundle/
text: SA1019
- linters:
- staticcheck
path: capabilities/
text: SA1019
- linters:
- staticcheck
path: compile/
text: SA1019
- linters:
- staticcheck
path: config/
text: SA1019
- linters:
- staticcheck
path: cover/
text: SA1019
- linters:
- staticcheck
path: debug/
text: SA1019
- linters:
- staticcheck
path: dependencies/
text: SA1019
- linters:
- staticcheck
path: download/
text: SA1019
- linters:
- staticcheck
path: format/
text: SA1019
- linters:
- staticcheck
path: hooks/
text: SA1019
- linters:
- staticcheck
path: ir/
text: SA1019
- linters:
- staticcheck
path: keys/
text: SA1019
- linters:
- staticcheck
path: loader/
text: SA1019
- linters:
- staticcheck
path: logging/
text: SA1019
- linters:
- staticcheck
path: metrics/
text: SA1019
- linters:
- staticcheck
path: plugins/
text: SA1019
- linters:
- staticcheck
path: profiler/
text: SA1019
- linters:
- staticcheck
path: refactor/
text: SA1019
- linters:
- staticcheck
path: repl/
text: SA1019
- linters:
- staticcheck
path: rego/
text: SA1019
- linters:
- staticcheck
path: resolver/
text: SA1019
- linters:
- staticcheck
path: runtime/
text: SA1019
- linters:
- staticcheck
path: schemas/
text: SA1019
- linters:
- staticcheck
path: sdk/
text: SA1019
- linters:
- staticcheck
path: server/
text: SA1019
- linters:
- staticcheck
path: storage/
text: SA1019
- linters:
- staticcheck
path: tester/
text: SA1019
- linters:
- staticcheck
path: topdown/
text: SA1019
- linters:
- staticcheck
path: tracing/
text: SA1019
- linters:
- staticcheck
path: types/
text: SA1019
- linters:
- staticcheck
path: util/
text: SA1019
- linters:
- staticcheck
path: version/
text: SA1019
- linters:
- staticcheck
text: QF1001
- linters:
- staticcheck
text: QF1002
- linters:
- staticcheck
text: QF1003
- linters:
- staticcheck
text: QF1008
- linters:
- staticcheck
text: QF1009
- linters:
- staticcheck
text: QF1012
paths:
- internal/gojsonschema
- third_party$
- builtin$
- examples$
issues:
# don't hide issues in CI runs because they are the same type
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- internal/gojsonschema
- third_party$
- builtin$
- examples$