-
Notifications
You must be signed in to change notification settings - Fork 101
/
.golangci.toml
199 lines (161 loc) · 4.14 KB
/
.golangci.toml
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
[run]
# This is needed for precious, which may run multiple instances
# in parallel
allow-parallel-runners = true
go = "1.23"
tests = true
timeout = "10m"
[linters]
enable-all = true
disable = [
"cyclop",
"depguard",
"err113",
"exhaustive",
"exhaustruct",
"exportloopref",
"forcetypeassert",
"funlen",
"gochecknoglobals",
"gocognit",
"godox",
"inamedparam",
"interfacebloat",
"mnd",
"nlreturn",
"nonamedreturns",
"paralleltest",
"thelper",
"testpackage",
"varnamelen",
"wrapcheck",
"wsl",
# Require Go 1.22
"copyloopvar",
"intrange",
]
[linters-settings.errorlint]
errorf = true
asserts = true
comparison = true
[linters-settings.exhaustive]
default-signifies-exhaustive = true
[linters-settings.forbidigo]
# Forbid the following identifiers
forbid = [
{ p = "Geoip", msg = "you should use `GeoIP`" },
{ p = "geoIP", msg = "you should use `geoip`" },
{ p = "Maxmind", msg = "you should use `MaxMind`" },
{ p = "^maxMind", msg = "you should use `maxmind`" },
{ p = "Minfraud", msg = "you should use `MinFraud`" },
{ p = "^minFraud", msg = "you should use `minfraud`" },
{ p = "^math.Max$", msg = "you should use the max built-in instead." },
{ p = "^math.Min$", msg = "you should use the min built-in instead." },
{ p = "^os.IsNotExist", msg = "As per their docs, new code should use errors.Is(err, fs.ErrNotExist)." },
{ p = "^os.IsExist", msg = "As per their docs, new code should use errors.Is(err, fs.ErrExist)" },
]
[linters-settings.gci]
sections = ["standard", "default", "prefix(github.com/oschwald/maxminddb-golang)"]
[linters-settings.gofumpt]
extra-rules = true
[linters-settings.gosec]
excludes = [
# integer overflow conversion. There are a lot of these and
# most seem safe or at least low risk.
"G115",
]
[linters-settings.govet]
enable-all = true
disable = "shadow"
[linters-settings.lll]
line-length = 120
tab-width = 4
[linters-settings.misspell]
locale = "US"
[[linters-settings.misspell.extra-words]]
typo = "marshall"
correction = "marshal"
[[linters-settings.misspell.extra-words]]
typo = "marshalling"
correction = "marshaling"
[[linters-settings.misspell.extra-words]]
typo = "marshalls"
correction = "marshals"
[[linters-settings.misspell.extra-words]]
typo = "unmarshall"
correction = "unmarshal"
[[linters-settings.misspell.extra-words]]
typo = "unmarshalling"
correction = "unmarshaling"
[[linters-settings.misspell.extra-words]]
typo = "unmarshalls"
correction = "unmarshals"
[linters-settings.nolintlint]
allow-unused = false
allow-no-explanation = ["lll", "misspell"]
require-explanation = true
require-specific = true
[linters-settings.revive]
enable-all-rules = true
ignore-generated-header = true
severity = "warning"
[[linters-settings.revive.rules]]
name = "add-constant"
disabled = true
[[linters-settings.revive.rules]]
name = "cognitive-complexity"
disabled = true
[[linters-settings.revive.rules]]
name = "confusing-naming"
disabled = true
[[linters-settings.revive.rules]]
name = "confusing-results"
disabled = true
[[linters-settings.revive.rules]]
name = "cyclomatic"
disabled = true
[[linters-settings.revive.rules]]
name = "deep-exit"
disabled = true
[[linters-settings.revive.rules]]
name = "flag-parameter"
disabled = true
[[linters-settings.revive.rules]]
name = "function-length"
disabled = true
[[linters-settings.revive.rules]]
name = "function-result-limit"
disabled = true
[[linters-settings.revive.rules]]
name = "line-length-limit"
disabled = true
[[linters-settings.revive.rules]]
name = "max-public-structs"
disabled = true
[[linters-settings.revive.rules]]
name = "nested-structs"
disabled = true
[[linters-settings.revive.rules]]
name = "unchecked-type-assertion"
disabled = true
[[linters-settings.revive.rules]]
name = "unhandled-error"
disabled = true
[linters-settings.tagliatelle.case.rules]
avro = "snake"
bson = "snake"
env = "upperSnake"
envconfig = "upperSnake"
json = "snake"
mapstructure = "snake"
xml = "snake"
yaml = "snake"
[linters-settings.unparam]
check-exported = true
[[issues.exclude-rules]]
linters = [
"govet",
"revive",
]
path = "_test.go"
text = "fieldalignment:"