-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy path.golangci.yml
More file actions
151 lines (149 loc) · 3.87 KB
/
.golangci.yml
File metadata and controls
151 lines (149 loc) · 3.87 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "2"
linters:
default: all
disable:
- depguard
- exhaustruct
- gochecknoinits
- wsl
- lll
- errchkjson
- ireturn
- gocheckcompilerdirectives
# noinlineerr: this codebase wholesale uses 'if err := X(); err != nil' inline form
# — 219+ occurrences across packages. Converting to plain-assignment style would
# produce a noisy diff with zero correctness benefit AND create variable-scope leaks
# in many places where err is locally scoped to the check.
- noinlineerr
# gomodguard: deprecated in v2.12+ in favour of gomodguard_v2; we don't use
# either (no allow/blocklists configured), so disable to silence the warning.
- gomodguard
settings:
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
gocritic:
disabled-checks:
- dupImport
- unnamedResult
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
funlen:
lines: 60
statements: 60
gomoddirectives:
# The cozystack fork of Talos carries a downstream-only patch
# (siderolabs/talos#12652, --skip-verify) that upstream declined.
# Until that flag lands upstream, the replace directive is the
# only way to consume the fork — it is not generic dependency
# rewriting and must stay.
replace-allow-list:
- github.com/siderolabs/talos
- github.com/siderolabs/talos/pkg/machinery
gocyclo:
min-complexity: 15
cyclop:
max-complexity: 15
mnd:
ignored-numbers:
- "10"
- "100"
- "1000"
- "2"
- "60"
- "60.0"
- "64"
- "500"
nolintlint:
require-explanation: true
require-specific: true
allow-unused: false
varnamelen:
max-distance: 5
min-name-length: 3
check-receiver: false
check-return: false
ignore-type-assert-ok: false
ignore-map-index-ok: false
ignore-chan-recv-ok: false
ignore-decls:
- wg sync.WaitGroup
- wg *sync.WaitGroup
- mu sync.Mutex
- ok bool
ignore-names:
- i
- w
- r
- b
- c
- m
- n
- tt
- rw
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- generated\.go$
- pkg/generated/
- \.claude/
rules:
- linters:
- funlen
- dupl
- gocognit
- gocyclo
- cyclop
- errcheck
- testableexamples
- testpackage
- forcetypeassert
- gocritic
- nlreturn
- wsl_v5
- varnamelen
- unparam
- modernize
- gosec
- testifylint
- perfsprint
- paralleltest
- maintidx
# goconst on _test.go: tests intentionally repeat literals
# (IPs, CIDRs, MAC addresses, YAML keys) inside backtick raw
# strings that are EXPECTED template outputs, alongside Go
# string literals used as assertion values. Substituting the
# Go literal into a const desynchronises it from the
# backtick fixture, breaking the test silently. Empirically
# observed during the strict-lint adoption pass: every
# blanket goconst substitution in pkg/engine/contract_*.go
# broke at least one TestRender* case. Sub-agent attempts
# failed for the same reason. Disable goconst on test files.
- goconst
path: _test\.go
formatters:
enable:
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- generated\.go$
- pkg/generated/
- \.claude/