-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.golangci.yml
More file actions
87 lines (85 loc) · 2.83 KB
/
Copy path.golangci.yml
File metadata and controls
87 lines (85 loc) · 2.83 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: "2"
linters:
# pkg/goldmark/ is the vendored goldmark@v1.8.2 fork. As a nested
# module it was never linted by this config; keep that status quo
# now that it is part of the main module (so `go install m@version`
# works) — upstream code predates these linters and grading it
# would drown real findings.
exclusions:
paths:
- pkg/goldmark
enable:
- errcheck
- funlen
- gocognit
- gocritic
- govet
- staticcheck
- unused
- ineffassign
- misspell
- lll
- perfsprint
- prealloc
- revive
settings:
lll:
line-length: 120
tab-width: 4
funlen:
lines: 60
statements: 40
gocognit:
min-complexity: 30
gocritic:
# docs/development/high-performance-go.md Tooling: "gocritic
# performance group are worth enabling". golangci-lint rejects
# combining disable-all with either disabled-tags or
# disabled-checks, so enabled-tags: [performance] can't be
# paired with a disabled-checks carve-out; enabled-checks
# spells out go-critic v0.14.3's full performance-tagged set
# (checkers/*.go Tags + checkers/rules/rules.go doc:tags)
# minus hugeParam/rangeValCopy instead.
#
# hugeParam/rangeValCopy flag 263 existing by-value struct
# params and for-range loops across cmd/mdsmith, internal/build,
# internal/config, and internal/schema — genuine wins, but each
# fix touches a function signature or call sites, and some
# types are used across package boundaries. That is a much
# larger, separately reviewable pass than a single perf-audit
# PR; tracked as follow-up debt per
# docs/development/high-performance-go.md Tooling rather than
# grandfathered silently. (golangci-lint's default
# max-same-issues/max-issues-per-linter caps hide the true
# count in a plain `run`; pass --max-issues-per-linter=0
# --max-same-issues=0 to see all of them.)
disable-all: true
enabled-checks:
- appendCombine
- rangeExprCopy
- preferDecodeRune
- stringXbytes
- indexAlloc
- preferWriteByte
- preferFprint
- preferStringWriter
- sliceClear
- equalFold
- zeroByteRepeat
perfsprint:
# error-format (fmt.Errorf → errors.New) fires ~180 times
# across the whole codebase, almost entirely on cold
# error-construction paths unrelated to a hot-path performance
# audit. string-format (fmt.Sprintf → string concatenation) is
# the check docs/development/high-performance-go.md actually
# calls out ("strconv over fmt.Sprintf"); kept on.
error-format: false
revive:
rules:
- name: exported
- name: var-naming
- name: blank-imports
formatters:
enable:
- gofmt
- goimports