Skip to content

Commit 6a3601a

Browse files
committed
chore: update golangci
Signed-off-by: Joseph Kato <joseph@jdkato.io>
1 parent 72b214f commit 6a3601a

File tree

2 files changed

+183
-70
lines changed

2 files changed

+183
-70
lines changed

.golangci.bck.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
run:
2+
timeout: 3m
3+
go: "1.23"
4+
5+
# This file contains only configs which differ from defaults.
6+
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
7+
linters-settings:
8+
cyclop:
9+
max-complexity: 30
10+
package-average: 10.0
11+
12+
errcheck:
13+
check-type-assertions: true
14+
15+
gocritic:
16+
settings:
17+
captLocal:
18+
paramsOnly: false
19+
underef:
20+
skipRecvDeref: false
21+
22+
gomodguard:
23+
blocked:
24+
modules:
25+
- github.com/golang/protobuf:
26+
recommendations:
27+
- google.golang.org/protobuf
28+
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
29+
- github.com/satori/go.uuid:
30+
recommendations:
31+
- github.com/google/uuid
32+
reason: "satori's package is not maintained"
33+
- github.com/gofrs/uuid:
34+
recommendations:
35+
- github.com/google/uuid
36+
reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw"
37+
38+
govet:
39+
enable-all: true
40+
disable:
41+
- fieldalignment
42+
43+
settings:
44+
shadow:
45+
strict: true
46+
47+
nakedret:
48+
max-func-lines: 0
49+
50+
nolintlint:
51+
allow-no-explanation: [funlen, gocognit, lll]
52+
require-explanation: false
53+
require-specific: true
54+
55+
rowserrcheck:
56+
packages:
57+
- github.com/jmoiron/sqlx
58+
59+
tenv:
60+
all: true
61+
62+
linters:
63+
disable-all: true
64+
enable:
65+
- errcheck
66+
- gosimple
67+
- govet
68+
- ineffassign
69+
- staticcheck
70+
- typecheck
71+
- unused
72+
- asciicheck
73+
- bidichk
74+
- bodyclose
75+
- contextcheck
76+
- dupl
77+
- dupword
78+
- durationcheck
79+
- errname
80+
- errorlint
81+
- exhaustive
82+
- gocritic
83+
- goimports
84+
- gomoddirectives
85+
- gomodguard
86+
- goprintffuncname
87+
- gosec
88+
- makezero
89+
- mirror
90+
- nakedret
91+
- nilerr
92+
- nilnil
93+
- noctx
94+
- nolintlint
95+
- nonamedreturns
96+
- nosprintfhostport
97+
- predeclared
98+
- promlinter
99+
- revive
100+
- rowserrcheck
101+
- sqlclosecheck
102+
- stylecheck
103+
- tenv
104+
- thelper
105+
- tparallel
106+
- unconvert
107+
- unparam
108+
- usestdlibvars
109+
- wastedassign
110+
- whitespace

.golangci.yml

Lines changed: 73 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,27 @@
1+
version: "2"
12
run:
2-
timeout: 3m
33
go: "1.23"
4-
5-
# This file contains only configs which differ from defaults.
6-
# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml
7-
linters-settings:
8-
cyclop:
9-
max-complexity: 30
10-
package-average: 10.0
11-
12-
errcheck:
13-
check-type-assertions: true
14-
15-
gocritic:
16-
settings:
17-
captLocal:
18-
paramsOnly: false
19-
underef:
20-
skipRecvDeref: false
21-
22-
gomodguard:
23-
blocked:
24-
modules:
25-
- github.com/golang/protobuf:
26-
recommendations:
27-
- google.golang.org/protobuf
28-
reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules"
29-
- github.com/satori/go.uuid:
30-
recommendations:
31-
- github.com/google/uuid
32-
reason: "satori's package is not maintained"
33-
- github.com/gofrs/uuid:
34-
recommendations:
35-
- github.com/google/uuid
36-
reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw"
37-
38-
govet:
39-
enable-all: true
40-
disable:
41-
- fieldalignment
42-
43-
settings:
44-
shadow:
45-
strict: true
46-
47-
nakedret:
48-
max-func-lines: 0
49-
50-
nolintlint:
51-
allow-no-explanation: [funlen, gocognit, lll]
52-
require-explanation: false
53-
require-specific: true
54-
55-
rowserrcheck:
56-
packages:
57-
- github.com/jmoiron/sqlx
58-
59-
tenv:
60-
all: true
61-
624
linters:
63-
disable-all: true
5+
default: none
646
enable:
65-
- errcheck
66-
- gosimple
67-
- govet
68-
- ineffassign
69-
- staticcheck
70-
- typecheck
71-
- unused
727
- asciicheck
738
- bidichk
749
- bodyclose
7510
- contextcheck
7611
- dupl
7712
- dupword
7813
- durationcheck
14+
- errcheck
7915
- errname
8016
- errorlint
8117
- exhaustive
8218
- gocritic
83-
- goimports
8419
- gomoddirectives
8520
- gomodguard
8621
- goprintffuncname
8722
- gosec
23+
- govet
24+
- ineffassign
8825
- makezero
8926
- mirror
9027
- nakedret
@@ -99,12 +36,78 @@ linters:
9936
- revive
10037
- rowserrcheck
10138
- sqlclosecheck
102-
- stylecheck
103-
- tenv
39+
- staticcheck
10440
- thelper
10541
- tparallel
10642
- unconvert
10743
- unparam
44+
- unused
10845
- usestdlibvars
10946
- wastedassign
11047
- whitespace
48+
settings:
49+
cyclop:
50+
max-complexity: 30
51+
package-average: 10
52+
errcheck:
53+
check-type-assertions: true
54+
gocritic:
55+
settings:
56+
captLocal:
57+
paramsOnly: false
58+
underef:
59+
skipRecvDeref: false
60+
gomodguard:
61+
blocked:
62+
modules:
63+
- github.com/golang/protobuf:
64+
recommendations:
65+
- google.golang.org/protobuf
66+
reason: see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules
67+
- github.com/satori/go.uuid:
68+
recommendations:
69+
- github.com/google/uuid
70+
reason: satori's package is not maintained
71+
- github.com/gofrs/uuid:
72+
recommendations:
73+
- github.com/google/uuid
74+
reason: 'see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw'
75+
govet:
76+
disable:
77+
- fieldalignment
78+
enable-all: true
79+
settings:
80+
shadow:
81+
strict: true
82+
nakedret:
83+
max-func-lines: 0
84+
nolintlint:
85+
require-explanation: false
86+
require-specific: true
87+
allow-no-explanation:
88+
- funlen
89+
- gocognit
90+
- lll
91+
rowserrcheck:
92+
packages:
93+
- github.com/jmoiron/sqlx
94+
exclusions:
95+
generated: lax
96+
presets:
97+
- comments
98+
- common-false-positives
99+
- legacy
100+
- std-error-handling
101+
paths:
102+
- third_party$
103+
- builtin$
104+
- examples$
105+
formatters:
106+
enable:
107+
- goimports
108+
exclusions:
109+
generated: lax
110+
paths:
111+
- third_party$
112+
- builtin$
113+
- examples$

0 commit comments

Comments
 (0)