Skip to content

Commit 0a30d59

Browse files
committed
ci: switch to golangci-lint v2
The configuration was migrated using golangci-lint migrate and when tweaked manually trying to minimize it. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 36bf233 commit 0a30d59

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

.github/workflows/validate.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
- uses: actions/checkout@v4
3434
- uses: actions/setup-go@v5
3535
with:
36-
go-version: 1.22.x
37-
- uses: golangci/golangci-lint-action@v6
36+
go-version: 1.24.x
37+
- uses: golangci/golangci-lint-action@v7
3838
with:
39-
version: v1.64
39+
version: v2.0
4040

4141
codespell:
4242
runs-on: ubuntu-24.04
@@ -61,10 +61,10 @@ jobs:
6161
- uses: actions/checkout@v4
6262
- uses: actions/setup-go@v5
6363
with:
64-
go-version: 1.22.x
65-
- uses: golangci/golangci-lint-action@v6
64+
go-version: 1.24.x
65+
- uses: golangci/golangci-lint-action@v7
6666
with:
67-
version: v1.64
67+
version: v2.0
6868
- name: test-stubs
6969
run: make test
7070

.golangci.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
---
2-
run:
3-
concurrency: 6
4-
timeout: 5m
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gofumpt
6+
57
linters:
68
enable:
79
# - copyloopvar # Detects places where loop variables are copied. TODO enable for Go 1.22+
810
- dupword # Detects duplicate words.
911
- errorlint # Detects code that may cause problems with Go 1.13 error wrapping.
1012
- gocritic # Metalinter; detects bugs, performance, and styling issues.
11-
- gofumpt # Detects whether code was gofumpt-ed.
1213
- gosec # Detects security problems.
1314
- misspell # Detects commonly misspelled English words in comments.
1415
- nilerr # Detects code that returns nil even if it checks that the error is not nil.
@@ -20,16 +21,24 @@ linters:
2021
- tparallel # Detects inappropriate usage of t.Parallel().
2122
- unconvert # Detects unnecessary type conversions.
2223
- usetesting # Reports uses of functions with replacement inside the testing package.
23-
linters-settings:
24-
govet:
25-
enable-all: true
26-
settings:
27-
shadow:
28-
strict: true
24+
settings:
25+
govet:
26+
enable-all: true
27+
settings:
28+
shadow:
29+
strict: true
30+
exclusions:
31+
generated: strict
32+
presets:
33+
- comments
34+
- common-false-positives
35+
- legacy
36+
- std-error-handling
37+
rules:
38+
- linters:
39+
- govet
40+
text: '^shadow: declaration of "err" shadows declaration'
41+
2942
issues:
3043
max-issues-per-linter: 0
3144
max-same-issues: 0
32-
exclude-rules:
33-
- text: '^shadow: declaration of "err" shadows declaration'
34-
linters:
35-
- govet

0 commit comments

Comments
 (0)