-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yml
More file actions
97 lines (91 loc) · 2.45 KB
/
.golangci.yml
File metadata and controls
97 lines (91 loc) · 2.45 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
version: "2"
formatters:
enable:
- gofmt
- goimports
linters:
enable:
- govet
- staticcheck
- errcheck
- ineffassign
- misspell
- gosec
- unconvert
- goconst
- unparam
- gocritic
settings:
govet:
enable-all: true
disable:
- shadow # `if err :=` shadowing is idiomatic Go; too noisy to enforce
- fieldalignment # struct field ordering is a micro-optimization, not a correctness issue
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
gocritic:
enabled-checks:
- docStub
- commentedOutCode
exclusions:
rules:
# Test files: skip safety and return-value checks
- path: ".*_test\\.go"
linters:
- gosec
- errcheck
- path: ".*_test\\.go"
text: "fieldalignment:"
# Test utility package: same exemption as _test.go files
- path: "internal/testutils/"
linters:
- errcheck
- gosec
# SDK deprecated fields — outside our control, suppress to avoid noise
- linters:
- staticcheck
text: "SA1019:"
# errcheck: defer *.Close() is idiomatic Go; errors in defer are not actionable
- linters:
- errcheck
text: '\.Close'
# errcheck: fmt.Fprint* writes to CLI output; errors are best-effort
- linters:
- errcheck
text: 'fmt\.Fprint'
# errcheck: io.Copy return value in pipe drains
- linters:
- errcheck
text: 'io\.Copy'
# errcheck: json.Encoder.Encode in test HTTP handlers
- linters:
- errcheck
text: 'Encoder.*Encode'
# errcheck: os cleanup calls in test setup
- linters:
- errcheck
text: 'os\.(Remove|MkdirAll|Setenv|Unsetenv)'
# gosec G104: Errors unhandled — errcheck linter already covers this; G104 is redundant noise
- linters:
- gosec
text: "G104:"
# gosec G115: int(fd) conversion for terminal detection is universally idiomatic
- linters:
- gosec
text: "G115:"
# gosec G304: os.ReadFile with path variable — config/app paths, not user input
- linters:
- gosec
text: "G304:"
# gosec G301/G302: intentional directory and file permission choices
- linters:
- gosec
text: "G30[12]:"
issues:
max-issues-per-linter: 0
max-same-issues: 0
run:
timeout: 5m