Skip to content

Commit b52e6c2

Browse files
bump golangci-lint to v2 (#1361)
Signed-off-by: Tyler Auerbeck <[email protected]> Co-authored-by: Tyler Auerbeck <[email protected]>
1 parent 3d50bb5 commit b52e6c2

File tree

2 files changed

+42
-35
lines changed

2 files changed

+42
-35
lines changed

.github/workflows/lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
steps:
2525
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
2626
with:
27-
go-version: "1.22"
27+
go-version: "1.23"
2828

2929
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
3030

3131
- name: golangci-lint
32-
uses: golangci/golangci-lint-action@v6.2.0
32+
uses: golangci/golangci-lint-action@v8.0.0
3333
with:
3434
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
3535
version: latest

.golangci.yaml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Documentation: https://golangci-lint.run/usage/configuration/
1+
version: "2"
2+
run:
3+
build-tags:
4+
- e2e
5+
modules-download-mode: vendor
6+
issues-exit-code: 1
27
linters:
3-
disable-all: true
8+
default: none
49
enable:
510
- bodyclose
611
- containedctx
@@ -16,11 +21,8 @@ linters:
1621
- exhaustive
1722
- goconst
1823
- gocritic
19-
- gofmt
20-
- goimports
2124
- gomodguard
2225
- gosec
23-
- gosimple
2426
- govet
2527
- ireturn
2628
- maintidx
@@ -36,40 +38,45 @@ linters:
3638
- revive
3739
- staticcheck
3840
- thelper
39-
- typecheck
4041
- unconvert
4142
- unparam
4243
- unused
4344
- usestdlibvars
4445
- whitespace
45-
linters-settings:
46-
depguard:
46+
settings:
47+
depguard:
48+
rules:
49+
main:
50+
list-mode: lax
51+
allow:
52+
- $gostd
53+
exclusions:
54+
generated: lax
55+
presets:
56+
- common-false-positives
57+
- legacy
58+
- std-error-handling
4759
rules:
48-
main:
49-
list-mode: lax
50-
allow:
51-
- $gostd
52-
output:
53-
uniq-by-line: false
60+
- linters:
61+
- errcheck
62+
- gosec
63+
path: _test\.go
64+
paths:
65+
- third_party$
66+
- builtin$
67+
- examples$
5468
issues:
55-
# Only flag new issues
56-
new: true
57-
exclude-rules:
58-
- path: _test\.go
59-
linters:
60-
- errcheck
61-
- gosec
6269
max-issues-per-linter: 0
6370
max-same-issues: 0
64-
include:
65-
# Enable off-by-default rules for revive requiring that all exported elements have a properly formatted comment.
66-
- EXC0012 # https://golangci-lint.run/usage/false-positives/#exc0012
67-
- EXC0014 # https://golangci-lint.run/usage/false-positives/#exc0014
68-
run:
69-
issues-exit-code: 1
70-
build-tags:
71-
- e2e
72-
# skip-dirs:
73-
# - vendor
74-
timeout: 20m
75-
modules-download-mode: vendor
71+
new: true
72+
uniq-by-line: false
73+
formatters:
74+
enable:
75+
- gofmt
76+
- goimports
77+
exclusions:
78+
generated: lax
79+
paths:
80+
- third_party$
81+
- builtin$
82+
- examples$

0 commit comments

Comments
 (0)