Skip to content

Commit 5506094

Browse files
committed
ci: switch to golangci-lint v2
The new configs were initially created by golangci-lint migrate, then tailored to simplify and minify. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent b66a3ea commit 5506094

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

.github/workflows/validate.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
- uses: actions/setup-go@v5
2828
with:
2929
go-version: "${{ env.GO_VERSION }}"
30-
- uses: golangci/golangci-lint-action@v6
30+
- uses: golangci/golangci-lint-action@v7
3131
with:
32-
version: v1.64
32+
version: v2.0
3333
# Extra linters, only checking new code from a pull request.
3434
- name: lint-extra
3535
if: github.event_name == 'pull_request'

.golangci-extra.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22
# github PRs only (see lint-extra in .github/workflows/validate.yml).
33
#
44
# For the default linter config, see .golangci.yml. This config should
5-
# only enable additional linters not enabled in the default config.
5+
# only enable additional linters and/or linter settings not enabled
6+
# in the default config.
7+
version: "2"
68

79
linters:
8-
disable-all: true
10+
default: none
911
enable:
1012
- godot
1113
- revive
12-
14+
- staticcheck
15+
settings:
16+
staticcheck:
17+
checks:
18+
- all
19+
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
20+
exclusions:
21+
generated: strict

.golangci.yml

+23-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
# For documentation, see https://golangci-lint.run/usage/configuration/
2+
version: "2"
3+
4+
formatters:
5+
enable:
6+
- gofumpt
7+
exclusions:
8+
generated: strict
29

310
linters:
411
enable:
512
- errorlint
6-
- gofumpt
713
- nolintlint
814
- unconvert
915
- unparam
10-
11-
linters-settings:
12-
govet:
13-
enable:
14-
- nilness
16+
settings:
17+
govet:
18+
enable:
19+
- nilness
20+
staticcheck:
21+
checks:
22+
- all
23+
- -ST1000 # https://staticcheck.dev/docs/checks/#ST1000 Incorrect or missing package comment.
24+
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier.
25+
- -ST1005 # https://staticcheck.dev/docs/checks/#ST1005 Incorrectly formatted error string.
26+
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
27+
exclusions:
28+
generated: strict
29+
presets:
30+
- comments
31+
- std-error-handling

0 commit comments

Comments
 (0)