-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy path.golangci.yml
More file actions
64 lines (63 loc) · 2.01 KB
/
Copy path.golangci.yml
File metadata and controls
64 lines (63 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: "2"
linters:
enable:
- depguard
- errcheck
- gochecknoglobals
- govet
- staticcheck
- unused
- wrapcheck
settings:
depguard:
rules:
no-stdlib-log:
files:
- "!$test"
deny:
- pkg: "log$"
desc: "Use logr (github.com/go-logr/logr) instead of stdlib log"
errcheck:
exclude-functions:
- (*os.File).Close
- (io.Closer).Close
- (io.ReadCloser).Close
- (*net.TCPListener).Close
- (net.Conn).Close
exclusions:
rules:
# Prometheus metrics are idiomatically registered as package-level vars.
- path: pkg/metrics/
linters: [gochecknoglobals]
# Build-time version vars injected via -ldflags.
- path: pkg/version/
linters: [gochecknoglobals]
# Existing package-level state predating gochecknoglobals.
- path: pkg/async/inference/flowcontrol/binary_metric_dispatch_gate\.go
linters: [gochecknoglobals]
- path: pkg/plugins/registry\.go
linters: [gochecknoglobals]
- path: pkg/pubsub/pubsubimpl\.go
linters: [gochecknoglobals]
- path: pkg/redis/(redisimpl|sortedset_impl)\.go
linters: [gochecknoglobals]
- path: pkg/server/(options|runner)\.go
linters: [gochecknoglobals]
# Existing unwrapped errors predating wrapcheck.
- path: internal/health/
linters: [wrapcheck]
- path: internal/logging/
linters: [wrapcheck]
- path: internal/otel/
linters: [wrapcheck]
- path: pkg/async/inference/flowcontrol/composite_gate\.go
linters: [wrapcheck]
- path: pkg/asyncworker/transform/gcsmultipart/
linters: [wrapcheck]
- path: pkg/redis/(quota_gate|redisimpl|sortedset_impl)\.go
linters: [wrapcheck]
- path: pkg/server/runner\.go
linters: [wrapcheck]
# Test files — enforce conventions on production code first.
- path: _test\.go
linters: [gochecknoglobals, wrapcheck]