Skip to content

Commit 6ada93f

Browse files
committed
ci: update golangci-lint workflow and configuration
- Update golangci-lint action from v6 to v7 - Specify version v2.0 for golangci-lint action - Change linter configuration to use default setting "none" - Remove individual linter enabling for gofmt, goimports, gosimple, stylecheck, typecheck - Add linter exclusions for generated code, common presets, and specific paths - Enable formatters for gofmt and goimports Signed-off-by: appleboy <appleboy.tw@gmail.com>
1 parent 2afd574 commit 6ada93f

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

.github/workflows/go.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ jobs:
3131
go-version-file: "go.mod"
3232
check-latest: true
3333
- name: Setup golangci-lint
34-
uses: golangci/golangci-lint-action@v6
34+
uses: golangci/golangci-lint-action@v7
3535
with:
36+
version: v2.0
3637
args: --verbose
3738

3839
- name: Bearer

.golangci.yml

+23-11
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
@@ -25,13 +21,29 @@ linters:
2521
- noctx
2622
- nolintlint
2723
- staticcheck
28-
- stylecheck
29-
- typecheck
3024
- unconvert
3125
- unparam
3226
- unused
3327
- whitespace
28+
exclusions:
29+
generated: lax
30+
presets:
31+
- comments
32+
- common-false-positives
33+
- legacy
34+
- std-error-handling
35+
paths:
36+
- third_party$
37+
- builtin$
38+
- examples$
39+
formatters:
40+
enable:
41+
- gofmt
3442
- gofumpt
35-
36-
run:
37-
timeout: 3m
43+
- goimports
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

0 commit comments

Comments
 (0)