Skip to content

Commit 6c5dc02

Browse files
committed
feat: upgraded linter config, more linters
1 parent d51f204 commit 6c5dc02

File tree

1 file changed

+61
-130
lines changed

1 file changed

+61
-130
lines changed

.golangci.json

Lines changed: 61 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
{
2+
"version": "2",
23
"formatters": {
34
"enable": [
4-
"gofmt"
5+
"gofmt",
6+
"gofumpt"
57
],
68
"exclusions": {
79
"generated": "lax",
810
"paths": [
911
".*\\.my\\.go$",
1012
"lib/bad.go",
11-
".github",
1213
".make",
14+
".vscode",
1315
"dist",
1416
"third_party$",
15-
"builtin$",
16-
"examples$"
17+
"builtin$"
1718
]
1819
},
1920
"settings": {
2021
"gci": {
2122
"sections": [
22-
"prefix(github.com/org/project)"
23+
"standard",
24+
"default",
25+
"prefix(github.com/bsv-blockchain/go-subtree)"
2326
]
2427
},
2528
"gofmt": {
@@ -30,126 +33,89 @@
3033
},
3134
"goimports": {
3235
"local-prefixes": [
33-
"github.com/org/project"
36+
"github.com/bsv-blockchain/go-subtree"
3437
]
3538
}
3639
}
3740
},
38-
"issues": {
39-
"max-issues-per-linter": 0,
40-
"max-same-issues": 0,
41-
"new": false,
42-
"new-from-rev": "",
43-
"uniq-by-line": true
44-
},
4541
"linters": {
46-
"disable": [
47-
"gocritic",
48-
"godot",
49-
"godox",
50-
"testifylint",
51-
"revive",
52-
"forbidigo",
53-
"err113",
54-
"errorlint",
55-
"gosec",
56-
"unused"
57-
],
5842
"enable": [
43+
"arangolint",
5944
"asasalint",
6045
"asciicheck",
61-
"err113",
6246
"bidichk",
6347
"bodyclose",
6448
"containedctx",
6549
"contextcheck",
6650
"copyloopvar",
6751
"dogsled",
68-
"recvcheck",
69-
"godox",
70-
"nilnil",
71-
"nilnesserr",
72-
"gomoddirectives",
7352
"durationcheck",
53+
"embeddedstructfieldcheck",
54+
"errcheck",
7455
"errchkjson",
7556
"errname",
7657
"errorlint",
7758
"exhaustive",
7859
"forbidigo",
60+
"funcorder",
7961
"gocheckcompilerdirectives",
8062
"gochecknoinits",
8163
"gochecksumtype",
64+
"goconst",
65+
"godox",
8266
"goheader",
67+
"gomoddirectives",
8368
"gosec",
8469
"gosmopolitan",
70+
"govet",
8571
"inamedparam",
72+
"ineffassign",
8673
"loggercheck",
8774
"makezero",
8875
"mirror",
8976
"misspell",
9077
"musttag",
78+
"nakedret",
9179
"nilerr",
80+
"nilnesserr",
81+
"nilnil",
9282
"noctx",
9383
"nolintlint",
9484
"nosprintfhostport",
9585
"prealloc",
9686
"predeclared",
9787
"protogetter",
9888
"reassign",
99-
"revive",
89+
"recvcheck",
10090
"rowserrcheck",
10191
"spancheck",
10292
"sqlclosecheck",
103-
"testifylint",
93+
"staticcheck",
10494
"unconvert",
10595
"unparam",
96+
"unused",
10697
"wastedassign",
98+
"wsl_v5",
10799
"zerologlint"
108100
],
109-
"exclusions": {
110-
"generated": "lax",
111-
"paths": [
112-
".*\\.my\\.go$",
113-
"lib/bad.go",
114-
".github",
115-
".make",
116-
"dist",
117-
"third_party$",
118-
"builtin$",
119-
"examples$"
120-
],
121-
"rules": [
122-
{
123-
"linters": [
124-
"gocyclo"
125-
],
126-
"path": "_test\\.go"
127-
},
128-
{
129-
"linters": [
130-
"testifylint"
131-
],
132-
"text": "suite-subtest-run: use ts.Run to run subtest"
133-
},
134-
{
135-
"linters": [
136-
"scopelint"
137-
],
138-
"text": "Using the variable on range scope"
139-
},
140-
{
141-
"linters": [
142-
"lll"
143-
],
144-
"source": "^//go:generate "
145-
},
146-
{
147-
"path": "(.+)\\.go$",
148-
"text": "abcdef"
149-
}
150-
]
151-
},
101+
"disable": [
102+
"err113",
103+
"gochecknoglobals",
104+
"gocognit",
105+
"gocritic",
106+
"gocyclo",
107+
"godot",
108+
"nestif",
109+
"revive",
110+
"testifylint"
111+
],
152112
"settings": {
113+
"funcorder": {
114+
"constructor-after-struct": true
115+
},
116+
"revive": {
117+
"config": ".revive.toml"
118+
},
153119
"dogsled": {
154120
"max-blank-identifiers": 2
155121
},
@@ -170,42 +136,23 @@
170136
"min-len": 3,
171137
"min-occurrences": 10
172138
},
173-
"gocritic": {
174-
"disabled-checks": [
175-
"regexpMust"
176-
],
177-
"disabled-tags": [
178-
"experimental"
179-
],
180-
"enabled-tags": [
181-
"performance"
182-
],
183-
"settings": {
184-
"captLocal": {
185-
"paramsOnly": true
186-
},
187-
"rangeValCopy": {
188-
"sizeThreshold": 32
189-
}
190-
}
191-
},
192139
"gocyclo": {
193140
"min-complexity": 10
194141
},
195142
"godox": {
196143
"keywords": [
197144
"NOTE",
198145
"OPTIMIZE",
199-
"HACK"
146+
"HACK",
147+
"ATTN",
148+
"ATTENTION"
200149
]
201150
},
202151
"govet": {
203-
"disable-all": false,
204152
"enable": [
205153
"atomicalign",
206154
"shadow"
207155
],
208-
"enable-all": false,
209156
"settings": {
210157
"printf": {
211158
"funcs": [
@@ -222,11 +169,11 @@
222169
"tab-width": 1
223170
},
224171
"misspell": {
172+
"locale": "US",
225173
"ignore-rules": [
226174
"bsv",
227175
"bitcoin"
228-
],
229-
"locale": "US"
176+
]
230177
},
231178
"nakedret": {
232179
"max-func-lines": 30
@@ -244,62 +191,46 @@
244191
"range-loops": true,
245192
"simple": true
246193
},
247-
"rowserrcheck": {
248-
"packages": [
249-
"github.com/jmoiron/sqlx"
250-
]
251-
},
252-
"testpackage": {
253-
"skip-regexp": "(export|internal)_test\\.go"
254-
},
255194
"unparam": {
256195
"check-exported": false
257196
},
258-
"whitespace": {
259-
"multi-func": false,
260-
"multi-if": false
261-
},
262197
"wsl": {
263198
"allow-assign-and-call": true,
264199
"allow-cuddle-declarations": true,
265200
"allow-multiline-assign": true,
266-
"allow-separated-leading-comment": false,
267-
"allow-trailing-comment": false,
268-
"force-case-trailing-whitespace": 0,
269-
"force-err-cuddling": false,
270201
"strict-append": true
271202
}
272203
}
273204
},
205+
"run": {
206+
"allow-parallel-runners": true,
207+
"concurrency": 8,
208+
"issues-exit-code": 1,
209+
"tests": true
210+
},
274211
"output": {
275212
"formats": {
276213
"text": {
277214
"path": "stdout",
278215
"print-issued-lines": true,
279216
"print-linter-name": true
280217
}
281-
},
282-
"path-prefix": ""
283-
},
284-
"run": {
285-
"allow-parallel-runners": false,
286-
"build-tags": [
287-
"mytag"
288-
],
289-
"concurrency": 4,
290-
"issues-exit-code": 1,
291-
"tests": true
218+
}
292219
},
293220
"severity": {
294-
"default": "error",
221+
"default": "warning",
295222
"rules": [
296223
{
297224
"linters": [
298-
"dupl"
225+
"dupl",
226+
"misspell",
227+
"makezero"
299228
],
300229
"severity": "info"
301230
}
302231
]
303232
},
304-
"version": "2"
233+
"issues": {
234+
"uniq-by-line": true
235+
}
305236
}

0 commit comments

Comments
 (0)