Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
141 lines (141 loc) · 3.8 KB
/
Copy path.golangci.yml
File metadata and controls
141 lines (141 loc) · 3.8 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "2"
issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- dogsled
- dupl
- gocritic
- govet
- ineffassign
- misspell
- nilerr
- nosprintfhostport
- perfsprint
- prealloc
- revive
- staticcheck
- thelper
- unconvert
- unused
- wastedassign
- whitespace
settings:
govet:
disable:
- deepequalerrors # Only seen this once and it's a false positive
- shadow # Probably not useful enough to clean everything up
- fieldalignment # TODO(peterebden): Should clean up these warnings and enable (although they are pretty finicky)
enable-all: true
settings:
printf:
funcs:
# These panic with fmt.Errorf(msg, args...) under the hood, so treating them as
# printf wrappers lets vet check their format strings/args like any other Errorf call.
- (*github.com/thought-machine/please/src/parse/asp.scope).Error
- (*github.com/thought-machine/please/src/parse/asp.scope).Assert
- (*github.com/thought-machine/please/src/parse/asp.scope).NAssert
perfsprint:
errorf: false # Sometimes it's easier not to import another package
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl
- errcheck
- gocritic
path: _test\.go
# The config struct is big and complex and there's usually only one.
- linters:
- govet
path: src/core/config.go
text: fieldalignment
# Similarly for flags.
- linters:
- govet
path: src/please.go
text: fieldalignment
# Too many false positives :(
- path: (.+)\.go$
text: SA4006
# Warns for duplicate struct tags which are meaningful to go-flags
- path: (.+)\.go$
text: SA5008
# This may be useful in some places.
- path: (.+)\.go$
text: unslice
# Generally don't agree.
- path: (.+)\.go$
text: ifElseChain
- path: (.+)\.go$
text: appendAssign
# Make misspell be quiet about this.
- path: (.+)\.go$
text: halp
# Potentially useful but not in any cases it fires right now.
- path: (.+)\.go$
text: exitAfterDefer
# Think this is confused about generics
- path: (.+)\.go$
text: receiver-naming
- path: (.+)\.go$
text: error-strings
# Potentially useful but we have quite a few cases to fix
- path: (.+)\.go$
text: unused-parameter
# Generally not useful
- path: (.+)\.go$
text: empty-block
- path: (.+)\.go$
text: redefines-builtin-id
- path: (.+)\.go$
text: superfluous-else
# revive getting a bit too pushy here
- path: (.+)\.go$
text: indent-error-flow
# Agree with this in principle, but there are too many instances of it to justify enabling it right now
- linters:
- staticcheck
path: (.+)\.go$
text: ST1005
paths:
- test_data
- third_party$
- ^plz-out$
- builtin$
- examples$
- tree
- plz-out
formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/thought-machine/please)
exclusions:
generated: lax
paths:
- test_data
- third_party$
- ^tree$
- ^plz-out$
- builtin$
- examples$
- tree
- plz-out