2025-03-31 15:51:44 +08:00
|
|
|
version: "2"
|
2020-11-25 17:17:03 +01:00
|
|
|
run:
|
2025-01-22 11:26:51 +08:00
|
|
|
timeout: 10m
|
2020-11-25 17:17:03 +01:00
|
|
|
linters:
|
|
|
|
enable:
|
2025-03-31 15:51:44 +08:00
|
|
|
- depguard
|
|
|
|
- exptostd
|
|
|
|
- godot
|
|
|
|
- iface
|
|
|
|
- nilnesserr
|
|
|
|
- recvcheck
|
2024-11-13 22:48:14 +08:00
|
|
|
- revive
|
2025-03-31 15:51:44 +08:00
|
|
|
- sloglint
|
|
|
|
- testifylint
|
|
|
|
- unconvert
|
|
|
|
settings:
|
|
|
|
depguard:
|
|
|
|
rules:
|
|
|
|
forbid-pkg-errors:
|
|
|
|
deny:
|
|
|
|
- pkg: github.com/pkg/errors
|
|
|
|
desc: Should be replaced with standard lib errors or fmt.Errorf
|
|
|
|
errcheck:
|
|
|
|
exclude-functions:
|
|
|
|
# Any error in HTTP handlers is handled by the server itself.
|
|
|
|
- (net/http.ResponseWriter).Write
|
|
|
|
exclusions:
|
|
|
|
generated: lax
|
|
|
|
presets:
|
|
|
|
- comments
|
|
|
|
- common-false-positives
|
|
|
|
- legacy
|
|
|
|
- std-error-handling
|
2023-09-30 13:22:03 +02:00
|
|
|
rules:
|
2025-03-31 15:51:44 +08:00
|
|
|
# Disable errcheck linter for test files.
|
|
|
|
- linters:
|
|
|
|
- errcheck
|
|
|
|
- staticcheck
|
|
|
|
- testifylint
|
|
|
|
path: _test.go
|
|
|
|
# We *frequently* use the term 'new' in the context of properties
|
|
|
|
# (new and old properties),
|
|
|
|
# and we rarely use the 'new' built-in function.
|
|
|
|
# It's fine to ignore these cases.
|
|
|
|
- linters:
|
|
|
|
- revive
|
|
|
|
text: 'redefines-builtin-id: redefinition of the built-in function new'
|
|
|
|
paths:
|
|
|
|
- third_party$
|
|
|
|
- builtin$
|
|
|
|
- examples$
|
|
|
|
formatters:
|
|
|
|
enable:
|
|
|
|
- gci
|
|
|
|
settings:
|
|
|
|
gci:
|
|
|
|
sections:
|
|
|
|
- standard
|
|
|
|
- default
|
|
|
|
- prefix(github.com/prometheus-operator/prometheus-operator)
|
|
|
|
exclusions:
|
|
|
|
generated: lax
|
|
|
|
paths:
|
|
|
|
- third_party$
|
|
|
|
- builtin$
|
|
|
|
- examples$
|