Skip to content

Commit 9a99d60

Browse files
authored
Merge pull request #354 from vulncheck-oss/fix/golangci-ling-v2
Migrate golanci-lint to v2
2 parents 70bcf85 + 31861ab commit 9a99d60

File tree

2 files changed

+53
-62
lines changed

2 files changed

+53
-62
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
go-version: '1.24.1'
2323

2424
- name: Install golangci-lint
25-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.7
25+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.2
2626

2727
- name: Build
2828
run: go build -v ./...

.golangci.yml

Lines changed: 52 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,23 @@
1-
# https://golangci-lint.run/usage/quick-start/
2-
run:
3-
timeout: 1m
4-
build-tags:
1+
version: "2"
52
linters:
6-
# https://golangci-lint.run/usage/linters/
7-
83
enable:
9-
- errcheck
10-
- gosimple
11-
- govet
12-
- ineffassign
13-
- staticcheck
14-
- typecheck
15-
- unused
164
- asasalint
175
- asciicheck
186
- bidichk
19-
#- bodyclose
207
- canonicalheader
218
- containedctx
229
- contextcheck
2310
- copyloopvar
2411
- cyclop
2512
- decorder
26-
#- depguard
2713
- dogsled
2814
- durationcheck
29-
#- dupword
30-
- errchkjson
3115
- err113
16+
- errchkjson
3217
- errname
3318
- errorlint
3419
- exhaustive
3520
- fatcontext
36-
#- forbidigo
37-
#- forcetypeassert
38-
- gci
3921
- ginkgolinter
4022
- gocheckcompilerdirectives
4123
- gochecksumtype
@@ -45,34 +27,24 @@ linters:
4527
- gocyclo
4628
- godot
4729
- godox
48-
- err113
49-
- gofmt
50-
- gofumpt
5130
- goheader
52-
- goimports
5331
- gomoddirectives
5432
- gomodguard
55-
#- goprintffuncname
56-
#- gosec
5733
- gosmopolitan
5834
- grouper
5935
- importas
6036
- interfacebloat
6137
- intrange
62-
#- lll
6338
- loggercheck
6439
- makezero
6540
- mirror
6641
- misspell
67-
#- mnd
6842
- musttag
6943
- nakedret
70-
#- nestif
7144
- nilerr
7245
- nilnesserr
7346
- nilnil
7447
- nlreturn
75-
#- noctx
7648
- nolintlint
7749
- nonamedreturns
7850
- perfsprint
@@ -86,45 +58,64 @@ linters:
8658
- rowserrcheck
8759
- sloglint
8860
- spancheck
89-
- stylecheck
9061
- sqlclosecheck
91-
- stylecheck
62+
- staticcheck
9263
- tagalign
9364
- tagliatelle
9465
- testifylint
9566
- unconvert
9667
- unparam
9768
- usestdlibvars
98-
#- varnamelen
9969
- wastedassign
10070
- whitespace
10171
- wrapcheck
10272
- zerologlint
103-
104-
linters-settings:
105-
cyclop:
106-
max-complexity: 25
107-
issues:
108-
exclude-rules:
109-
- path: c2/sslshell/sslshellserver.go
110-
linters:
111-
- staticcheck
112-
text: SA1019
113-
- path: c2/httpservefile/httpservefile.go
114-
linters:
115-
- staticcheck
116-
text: SA1019
117-
- path: httphelper.go
118-
linters:
119-
- staticcheck
120-
text: SA1019
121-
- path: c2/shelltunnel/shelltunnel.go
122-
linters:
123-
- staticcheck
124-
text: SA1019
125-
- path: cli/commandline_test.go
126-
linters:
127-
- staticcheck
128-
text: SA1019
129-
exclude-files:
130-
- protocol/mikrotik/msg.go
73+
settings:
74+
cyclop:
75+
max-complexity: 25
76+
exclusions:
77+
generated: lax
78+
presets:
79+
- comments
80+
- common-false-positives
81+
- legacy
82+
- std-error-handling
83+
rules:
84+
- linters:
85+
- staticcheck
86+
path: c2/sslshell/sslshellserver.go
87+
text: SA1019
88+
- linters:
89+
- staticcheck
90+
path: c2/httpservefile/httpservefile.go
91+
text: SA1019
92+
- linters:
93+
- staticcheck
94+
path: httphelper.go
95+
text: SA1019
96+
- linters:
97+
- staticcheck
98+
path: c2/shelltunnel/shelltunnel.go
99+
text: SA1019
100+
- linters:
101+
- staticcheck
102+
path: cli/commandline_test.go
103+
text: SA1019
104+
paths:
105+
- protocol/mikrotik/msg.go
106+
- third_party$
107+
- builtin$
108+
- examples$
109+
formatters:
110+
enable:
111+
- gci
112+
- gofmt
113+
- gofumpt
114+
- goimports
115+
exclusions:
116+
generated: lax
117+
paths:
118+
- protocol/mikrotik/msg.go
119+
- third_party$
120+
- builtin$
121+
- examples$

0 commit comments

Comments
 (0)