-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy path.golangci.yml
More file actions
72 lines (70 loc) · 2.34 KB
/
Copy path.golangci.yml
File metadata and controls
72 lines (70 loc) · 2.34 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
version: "2"
linters:
enable:
- copyloopvar
- errcheck
- errorlint
- govet
- ineffassign
- intrange
- modernize
- staticcheck
- unused
- usestdlibvars
settings:
modernize:
# omitempty -> omitzero changes which fields are written for nested
# structs. That is a wire-format change to session files and the
# extension protocol, not a refactor, so it lands on its own.
disable:
- omitzero
errcheck:
check-type-assertions: false
exclude-functions:
- (*os.File).Close
- (io.Closer).Close
- (*net/http.Response).Body.Close
- golang.org/x/term.Restore
# Win32: CloseHandle in a defer mirrors the Close exclusions above, and
# LazyProc.Call always returns a non-nil errno — the caller reads r1.
- golang.org/x/sys/windows.CloseHandle
- (*syscall.LazyProc).Call
- (*golang.org/x/sys/windows.LazyProc).Call
staticcheck:
checks:
- all
- -ST1005 # error strings ending with punctuation — too strict for initial adoption
- -ST1018 # Unicode format characters — intentional in TUI code
- -QF1001 # De Morgan's law — readability preference
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
# Setup/teardown in tests routinely ignores cleanup errors.
- path: _test\.go
linters:
- errcheck
# The pinned golangci-lint binary's staticcheck reports SA5011 false
# positives on `if x == nil { t.Fatal(...) }`-guarded derefs in tests (it
# doesn't treat t.Fatal as terminating); the same code is clean under a
# locally-built golangci-lint. Scope the suppression to tests so SA5011
# still guards production code.
- path: _test\.go
linters:
- staticcheck
text: SA5011
# SA4023 is trivially true on GOOS=windows: dialAgent's Windows stub
# (agent_windows.go) always returns a non-nil error until named-pipe
# transport lands. Suppress only this call site; the comparison stays
# meaningful on Unix where dialAgent can succeed.
- path: internal/remote/auth\.go
linters:
- staticcheck
text: SA4023
issues:
max-issues-per-linter: 0
max-same-issues: 0