-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path.golangci.yaml
More file actions
110 lines (105 loc) · 2.64 KB
/
Copy path.golangci.yaml
File metadata and controls
110 lines (105 loc) · 2.64 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
version: "2"
run:
timeout: 10m
concurrency: 16
issues-exit-code: 1
tests: true
output:
formats:
text:
path: stdout
colors: true
linters:
default: none
enable:
- asasalint
- bodyclose
- containedctx
- contextcheck
- dogsled
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
- forcetypeassert
- gocheckcompilerdirectives
- gocritic
- godox
- goprintffuncname
- gosmopolitan
- govet
- ineffassign
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nilerr
- noctx
- predeclared
- reassign
- staticcheck
- tagalign
- testableexamples
- testifylint
- thelper
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace
settings:
godox:
keywords:
- FIXME
errcheck:
# Exclude write/print/close patterns where the error is conventionally
# ignored: strings.Builder / bytes.Buffer never error; fmt.Fprint* on
# printers/log writers is fire-and-forget; deferred Close on read-only
# files has nothing meaningful to do with the error.
exclude-functions:
- (*strings.Builder).WriteString
- (*strings.Builder).WriteByte
- (*strings.Builder).WriteRune
- (*bytes.Buffer).WriteString
- (*bytes.Buffer).WriteByte
- (*bytes.Buffer).WriteRune
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
- (io.Closer).Close
- (*os.File).Close
- os.Remove
exclusions:
rules:
# QF1008 "could remove embedded field from selector" is cosmetic.
# ST1001 "should not use dot imports" is intentional in showcase/main.go.
- linters: [staticcheck]
text: "(QF1008|ST1001):"
# defer x.Close() on gzip/tar writers, ws conns, etc. — concrete types
# implementing io.Closer that errcheck's interface exclude won't match.
- linters: [errcheck]
source: "^\\s*defer .+\\.Close\\(\\)"
# These sentinels match exact stderr output from wireguard/ip; lowering
# them would break string comparisons.
- linters: [staticcheck]
path: src/cmdRunner/run.go
text: "ST1005:"
# Integration tests marshal internal persisted structs (e.g.
# cliStorage.Data) to seed on-disk state. Those types intentionally rely
# on Go's default field-name JSON keys, so don't require explicit tags.
- linters: [musttag]
path: _test\.go$
issues:
max-same-issues: 0
formatters:
enable:
- gofmt
- goimports