-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy path.golangci.yml
More file actions
57 lines (53 loc) · 1.91 KB
/
Copy path.golangci.yml
File metadata and controls
57 lines (53 loc) · 1.91 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
version: "2"
run:
timeout: 5m
# Mirrors the cloud repo's config. `default: standard` = errcheck, govet,
# ineffassign, staticcheck, unused. Tighten by enabling more linters once a
# clean baseline holds.
linters:
default: standard
enable:
# gosec, scoped to G115 only (integer-overflow conversions). The rest of
# gosec's rules aren't enforced yet — enabling them wholesale would surface
# a separate debt. G115 is clean as of the safecast rollout, so gate it to
# prevent regressions: new unchecked int conversions must go through
# internal/safecast (or carry a justified //nolint:gosec).
- gosec
settings:
gosec:
includes:
- G115
errcheck:
# Conventionally-unchecked stdlib calls. Their errors are not actionable
# in the contexts we use them (deferred cleanup, best-effort writes to an
# already-failing response/stderr), so we exempt the functions rather
# than litter the tree with `_ =`. Domain calls (store/incus/exec/parse)
# are NOT here — those are fixed in code so a real error can't be dropped.
exclude-functions:
- (io.Closer).Close
- (io.ReadCloser).Close
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
- (net/http.ResponseWriter).Write
exclusions:
# Generated code is not ours to lint — protoc output is gofmt-clean but
# trips errcheck/staticcheck on patterns we don't control.
generated: lax
paths:
- pkg/pb
- test/fixtures
# Vendored Go shipped inside JS tooling (flatted) — not our code.
- web-ui/node_modules
# Formatters run during `golangci-lint run` (v2): an unformatted file fails
# the lint job. gofmt runs with simplify on by default (== gofmt -s), matching
# the standalone gofmt workflow's `gofmt -s -l` gate.
formatters:
enable:
- gofmt
exclusions:
paths:
- pkg/pb
issues:
max-issues-per-linter: 0
max-same-issues: 0