-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yml
More file actions
105 lines (101 loc) · 2.57 KB
/
Copy path.golangci.yml
File metadata and controls
105 lines (101 loc) · 2.57 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
version: "2"
run:
timeout: 5m
linters:
enable:
- errcheck
- govet
- staticcheck
- unused
- ineffassign
- gocritic
- misspell
- bodyclose
- durationcheck
- errname
- nilerr
- sqlclosecheck
- unconvert
- unparam
- wastedassign
settings:
errcheck:
check-type-assertions: false
check-blank: false
exclude-functions:
# Network cleanup — errors not actionable
- (net.Conn).Close
- (net.Conn).SetDeadline
- (net.Conn).SetReadDeadline
- (*net.UDPConn).Close
- (*net.UDPConn).SetDeadline
- (*net.UDPConn).SetReadDeadline
- (*net.UDPConn).WriteToUDP
- (*database/sql.DB).Close
- (*os.File).Close
- (io.Closer).Close
- (*io.PipeWriter).Close
- (*mime/multipart.Writer).Close
- (*net/http.Response).Body.Close
- os.Remove
- os.MkdirAll
- encoding/json.Unmarshal
- (*encoding/json.Encoder).Encode
- (*encoding/json.Decoder).Decode
gocritic:
enabled-tags:
- diagnostic
- performance
disabled-checks:
- hugeParam
- rangeValCopy
- ifElseChain
- filepathJoin
- exitAfterDefer
misspell:
locale: US
exclusions:
paths:
- web
- site
- build
- migrations
rules:
# Test files: relax errcheck and unparam
- path: _test\.go
linters:
- unparam
- errcheck
- gocritic
# Defer cleanup — error is not actionable
- linters:
- errcheck
source: "defer "
# Deprecated websocket library — tracked separately
- linters:
- staticcheck
text: "SA1019:"
# IPv6 hostport in printer discovery
- linters:
- govet
text: "hostport"
# "cancelled" is used in JSON struct tags and API responses
- linters:
- misspell
text: "(?i)cancelled"
# Best-effort event logging / audit trail
- linters:
- errcheck
source: "AddEvent|AppendEvent"
# Best-effort cleanup of OAuth state
- linters:
- errcheck
source: "DeleteOAuthState|UpdateLastSync|UpdateWebhookEventProcessed"
# Background printer connections (fire-and-forget goroutines)
- linters:
- errcheck
source: "go s\\.(manager|printerMgr)\\.Connect"
# Migration ALTER TABLE — intentionally ignores "column already exists"
- linters:
- errcheck
source: "// Ignore error if"