-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.golangci.yml
More file actions
42 lines (35 loc) · 1.51 KB
/
.golangci.yml
File metadata and controls
42 lines (35 loc) · 1.51 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
version: "2"
linters:
default: none
enable:
- errcheck # unchecked errors
- govet # go vet passes
- staticcheck # broad static analysis (SA, S, ST, S1 families — includes gosimple)
- unused # unexported identifiers never used
- ineffassign # assignments whose value is never read
- bodyclose # HTTP response body not closed
- noctx # HTTP requests without context
- godot # comments should end with a period
settings:
godot:
scope: toplevel # only top-level declarations (doc comments)
period: true
exclusions:
rules:
# Ignoring Close() errors on defer is idiomatic Go — the body is already consumed.
- linters: [errcheck]
text: "Error return value of `(.*\\.Close|.*\\.Body\\.Close)` is not checked"
# fmt.Fprint* to io.Writer in CLI output: errors are not actionable.
- linters: [errcheck]
text: "Error return value of `fmt\\.Fprint"
# viper.BindPFlag only errors when a flag name is misspelled — a programming error
# caught at startup; panic via init() is the idiomatic Cobra/Viper response.
- linters: [errcheck]
text: "Error return value of `viper\\.BindPFlag` is not checked"
# QF1012 is a stylistic quick-fix suggestion (WriteString+Sprintf → Fprintf).
# The code is correct as written; suppressing globally to avoid churn.
- linters: [staticcheck]
text: "QF1012:"
issues:
max-issues-per-linter: 30
max-same-issues: 5