Skip to content

Commit 13dd4ed

Browse files
committed
migrate config
Signed-off-by: Carlos Panato <[email protected]>
1 parent bcc528f commit 13dd4ed

File tree

2 files changed

+91
-91
lines changed

2 files changed

+91
-91
lines changed

.golangci.yml

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,8 @@
1-
---
1+
version: "2"
22
run:
33
concurrency: 6
4-
timeout: 10m
5-
6-
issues:
7-
exclude-rules:
8-
# counterfeiter fakes are usually named 'fake_<something>.go'
9-
- path: fake_.*\.go
10-
linters:
11-
- gocritic
12-
- golint
13-
- dupl
14-
- path: examples/*
15-
linters:
16-
- gocritic
17-
- golint
18-
- dupl
19-
- staticcheck
20-
- goconst
21-
- errcheck
22-
- stylecheck #Since Example packages have _ in them this will break a bunch of tests unless we rename all of those packages
23-
exclude-dirs-use-default: false
24-
exclude-dirs:
25-
- (^|/)vendor($|/)
26-
- (^|/)testdata($|/)
27-
- (^|/)Godeps($|/)
28-
- (^|/)builtin($|/)
29-
- .*.gvm/.* # This is enabled to avoid linting the gvm install directory
304
linters:
31-
disable-all: true
5+
default: none
326
enable:
337
- asciicheck
348
- bodyclose
@@ -39,81 +13,107 @@ linters:
3913
- gocritic
4014
- gocyclo
4115
- godox
42-
- gofmt
43-
- gofumpt
4416
- goheader
45-
- goimports
46-
- revive
4717
- gomodguard
4818
- goprintffuncname
49-
- gosimple
5019
- govet
5120
- ineffassign
5221
- misspell
5322
- nakedret
5423
- prealloc
24+
- revive
5525
- rowserrcheck
5626
- sqlclosecheck
5727
- staticcheck
58-
- stylecheck
59-
- typecheck
6028
- unconvert
6129
- unparam
6230
- unused
6331
- whitespace
64-
65-
linters-settings:
66-
revive:
67-
confidence: 0.01
32+
settings:
33+
errcheck:
34+
check-type-assertions: true
35+
check-blank: true
36+
gocritic:
37+
enabled-checks:
38+
- commentedOutCode
39+
- nilValReturn
40+
- sloppyReassign
41+
- weakCond
42+
- octalLiteral
43+
- appendCombine
44+
- equalFold
45+
- hugeParam
46+
- indexAlloc
47+
- rangeExprCopy
48+
- rangeValCopy
49+
- boolExprSimplify
50+
- commentedOutImport
51+
- docStub
52+
- emptyFallthrough
53+
- emptyStringTest
54+
- hexLiteral
55+
- methodExprCall
56+
- stringXbytes
57+
- typeAssertChain
58+
- unlabelStmt
59+
- yodaStyleExpr
60+
- builtinShadow
61+
- importShadow
62+
- initClause
63+
- nestingReduce
64+
- paramTypeCombine
65+
- ptrToRefParam
66+
- typeUnparen
67+
- unnamedResult
68+
- unnecessaryBlock
69+
godox:
70+
keywords:
71+
- BUG
72+
- FIXME
73+
- HACK
74+
revive:
75+
confidence: 0.01
76+
rules:
77+
- name: duplicated-imports
78+
severity: error
79+
disabled: false
80+
exclusions:
81+
generated: lax
82+
presets:
83+
- comments
84+
- common-false-positives
85+
- legacy
86+
- std-error-handling
6887
rules:
69-
- name: duplicated-imports
70-
severity: error
71-
disabled: false
72-
godox:
73-
keywords:
74-
- BUG
75-
- FIXME
76-
- HACK
77-
errcheck:
78-
check-type-assertions: true
79-
check-blank: true
80-
gocritic:
81-
enabled-checks:
82-
# Diagnostic
83-
- commentedOutCode
84-
- nilValReturn
85-
- sloppyReassign
86-
- weakCond
87-
- octalLiteral
88-
89-
# Performance
90-
- appendCombine
91-
- equalFold
92-
- hugeParam
93-
- indexAlloc
94-
- rangeExprCopy
95-
- rangeValCopy
96-
97-
# Style
98-
- boolExprSimplify
99-
- commentedOutImport
100-
- docStub
101-
- emptyFallthrough
102-
- emptyStringTest
103-
- hexLiteral
104-
- methodExprCall
105-
- stringXbytes
106-
- typeAssertChain
107-
- unlabelStmt
108-
- yodaStyleExpr
109-
110-
# Opinionated
111-
- builtinShadow
112-
- importShadow
113-
- initClause
114-
- nestingReduce
115-
- paramTypeCombine
116-
- ptrToRefParam
117-
- typeUnparen
118-
- unnamedResult
119-
- unnecessaryBlock
88+
- linters:
89+
- dupl
90+
- gocritic
91+
- golint
92+
path: fake_.*\.go
93+
- linters:
94+
- dupl
95+
- errcheck
96+
- goconst
97+
- gocritic
98+
- golint
99+
- staticcheck
100+
path: examples/*
101+
paths:
102+
- (^|/)vendor($|/)
103+
- (^|/)testdata($|/)
104+
- (^|/)Godeps($|/)
105+
- (^|/)builtin($|/)
106+
- .*.gvm/.*
107+
formatters:
108+
enable:
109+
- gofmt
110+
- gofumpt
111+
- goimports
112+
exclusions:
113+
generated: lax
114+
paths:
115+
- (^|/)vendor($|/)
116+
- (^|/)testdata($|/)
117+
- (^|/)Godeps($|/)
118+
- (^|/)builtin($|/)
119+
- .*.gvm/.*

hack/verify-golangci-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21-
VERSION=v1.63.4
21+
VERSION=v2.1.6
2222
URL_BASE=https://raw.githubusercontent.com/golangci/golangci-lint
2323
URL=$URL_BASE/$VERSION/install.sh
2424

0 commit comments

Comments
 (0)