Skip to content

Commit 61539f5

Browse files
committed
ci: update linting configuration and dependencies in GitHub Actions
- Update golangci-lint-action to v7 in the GitHub Actions workflow - Update codecov-action to v5 in the GitHub Actions workflow - Set golangci-lint configuration version to "2" - Replace `enable-all`, `disable-all`, and `fast` settings with `default: none` - Remove specific linters: gofmt, goimports, gosimple, stylecheck, typecheck - Add exclusions for generated code and predefined presets - Add formatting tools: gofmt, goimports - Include exclusions for certain paths like third_party, builtin, and examples Signed-off-by: appleboy <[email protected]>
1 parent d41079e commit 61539f5

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

.github/workflows/testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
go-version-file: go.mod
2929
check-latest: true
3030
- name: Setup golangci-lint
31-
uses: golangci/golangci-lint-action@v6
31+
uses: golangci/golangci-lint-action@v7
3232
with:
3333
version: latest
3434
args: --verbose
@@ -74,7 +74,7 @@ jobs:
7474
make test
7575
7676
- name: Upload coverage to Codecov
77-
uses: codecov/codecov-action@v4
77+
uses: codecov/codecov-action@v5
7878
with:
7979
flags: ${{ matrix.os }},go-${{ matrix.go }}
8080

.golangci.yml

Lines changed: 23 additions & 10 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
@@ -11,11 +10,8 @@ linters:
1110
- goconst
1211
- gocritic
1312
- gocyclo
14-
- gofmt
15-
- goimports
1613
- goprintffuncname
1714
- gosec
18-
- gosimple
1915
- govet
2016
- ineffassign
2117
- misspell
@@ -24,12 +20,29 @@ linters:
2420
- nolintlint
2521
- rowserrcheck
2622
- staticcheck
27-
- stylecheck
28-
- typecheck
2923
- unconvert
3024
- unparam
3125
- unused
3226
- whitespace
27+
exclusions:
28+
generated: lax
29+
presets:
30+
- comments
31+
- common-false-positives
32+
- legacy
33+
- std-error-handling
34+
paths:
35+
- third_party$
36+
- builtin$
37+
- examples$
38+
formatters:
39+
enable:
40+
- gofmt
3341
- gofumpt
34-
run:
35-
timeout: 3m
42+
- goimports
43+
exclusions:
44+
generated: lax
45+
paths:
46+
- third_party$
47+
- builtin$
48+
- examples$

0 commit comments

Comments
 (0)