Skip to content

Commit b1ef72d

Browse files
authored
chore(golangci-lint): migrate configuration to v2 (#321)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 63450e8 commit b1ef72d

File tree

3 files changed

+68
-34
lines changed

3 files changed

+68
-34
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
permissions:
1111
contents: read
12-
pull-requests: read
1312

1413
jobs:
1514
golangci:
@@ -21,8 +20,4 @@ jobs:
2120
with:
2221
go-version: 1.23.x
2322
- name: golangci-lint
24-
uses: golangci/golangci-lint-action@v6
25-
with:
26-
args: --timeout=10m
27-
# Only show new issues in a PR but show all issues for pushes
28-
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
23+
uses: golangci/golangci-lint-action@v7

.golangci.yml

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
1-
issues:
2-
exclude-dirs:
3-
- docs
4-
max-issues-per-linter: 0
5-
max-same-issues: 0
1+
version: "2"
2+
run:
3+
issues-exit-code: 1
4+
tests: false
65
linters:
7-
disable:
8-
- depguard
96
enable:
10-
- errcheck
11-
- gosimple
12-
- govet
13-
- ineffassign
14-
- staticcheck
15-
- unused
16-
# Defaults above ours below
7+
- asasalint
8+
- asciicheck
9+
- bidichk
10+
- bodyclose
11+
- contextcheck
1712
- copyloopvar
13+
- durationcheck
14+
- errchkjson
15+
- errorlint
16+
- exhaustive
17+
- fatcontext
18+
- gocheckcompilerdirectives
19+
- gochecksumtype
20+
- gomodguard
21+
- gosec
22+
- gosmopolitan
23+
- loggercheck
24+
- makezero
25+
- musttag
26+
- nilerr
27+
- nilnesserr
28+
- noctx
29+
- perfsprint
30+
- prealloc
31+
- protogetter
32+
- reassign
33+
- recvcheck
34+
- rowserrcheck
35+
- spancheck
36+
- sqlclosecheck
37+
- testifylint
38+
- unparam
1839
- usestdlibvars
1940
- whitespace
20-
presets:
21-
- bugs
22-
- format
23-
- import
24-
- performance
25-
- unused
26-
#linters-settings:
27-
# errcheck:
28-
# check-type-assertions: true
29-
run:
30-
issues-exit-code: 1
31-
tests: false
32-
timeout: 10m
41+
- zerologlint
42+
disable:
43+
- depguard
44+
exclusions:
45+
generated: lax
46+
presets:
47+
- comments
48+
- common-false-positives
49+
- legacy
50+
- std-error-handling
51+
paths:
52+
- docs
53+
- third_party$
54+
- builtin$
55+
- examples$
56+
issues:
57+
max-issues-per-linter: 0
58+
max-same-issues: 0
59+
formatters:
60+
enable:
61+
- gci
62+
- gofmt
63+
- gofumpt
64+
- goimports
65+
exclusions:
66+
generated: lax
67+
paths:
68+
- docs
69+
- third_party$
70+
- builtin$
71+
- examples$

internal/dns/dns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func copyResponse(req *dns.Msg, srcResp *dns.Msg, destResp *dns.Msg) {
302302
return
303303
}
304304
// Copy relevant data from original request and source response into destination response
305-
destResp.SetRcode(req, srcResp.MsgHdr.Rcode)
305+
destResp.SetRcode(req, srcResp.Rcode)
306306
destResp.RecursionDesired = req.RecursionDesired
307307
destResp.RecursionAvailable = srcResp.RecursionAvailable
308308
if srcResp.Ns != nil {

0 commit comments

Comments
 (0)