Skip to content

Commit 51b8fb3

Browse files
committed
ci: update GolangCI configurations and GitHub workflow integration
- Update golangci-lint action from v5 to v7 - Specify version v2.0 for golangci-lint in GitHub workflow - Add `version: "2"` to `.golangci.yml` - Replace `enable-all` and `disable-all` with `default: none` in `.golangci.yml` - Remove specific linters (`gofmt`, `goimports`, `gosimple`, `stylecheck`, `typecheck`) from `.golangci.yml` - Add linter exclusions and presets to `.golangci.yml` - Add formatter configurations for `gofmt` and `goimports` in `.golangci.yml` - Remove `run: timeout: 3m` from `.golangci.yml` Signed-off-by: appleboy <[email protected]>
1 parent 91a5338 commit 51b8fb3

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

.github/workflows/go.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
go-version-file: go.mod
2424
check-latest: true
2525
- name: Setup golangci-lint
26-
uses: golangci/golangci-lint-action@v5
26+
uses: golangci/golangci-lint-action@v7
2727
with:
28+
version: v2.0
2829
args: --verbose
2930
test:
3031
strategy:

.golangci.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
version: "2"
12
linters:
2-
enable-all: false
3-
disable-all: true
4-
fast: false
3+
default: none
54
enable:
65
- bodyclose
76
- dogsled
@@ -12,11 +11,8 @@ linters:
1211
- goconst
1312
- gocritic
1413
- gocyclo
15-
- gofmt
16-
- goimports
1714
- goprintffuncname
1815
- gosec
19-
- gosimple
2016
- govet
2117
- ineffassign
2218
- lll
@@ -26,13 +22,29 @@ linters:
2622
- nolintlint
2723
- rowserrcheck
2824
- staticcheck
29-
- stylecheck
30-
- typecheck
3125
- unconvert
3226
- unparam
3327
- unused
3428
- whitespace
29+
exclusions:
30+
generated: lax
31+
presets:
32+
- comments
33+
- common-false-positives
34+
- legacy
35+
- std-error-handling
36+
paths:
37+
- third_party$
38+
- builtin$
39+
- examples$
40+
formatters:
41+
enable:
42+
- gofmt
3543
- gofumpt
36-
37-
run:
38-
timeout: 3m
44+
- goimports
45+
exclusions:
46+
generated: lax
47+
paths:
48+
- third_party$
49+
- builtin$
50+
- examples$

0 commit comments

Comments
 (0)