Skip to content

chore(golangci-lint): migrate configuration to v2 #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
Expand All @@ -21,8 +20,4 @@ jobs:
with:
go-version: 1.23.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout=10m
# Only show new issues in a PR but show all issues for pushes
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
uses: golangci/golangci-lint-action@v7
93 changes: 66 additions & 27 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,71 @@
issues:
exclude-dirs:
- docs
max-issues-per-linter: 0
max-same-issues: 0
version: "2"
run:
issues-exit-code: 1
tests: false
linters:
disable:
- depguard
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
# Defaults above ours below
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- copyloopvar
- durationcheck
- errchkjson
- errorlint
- exhaustive
- fatcontext
- gocheckcompilerdirectives
- gochecksumtype
- gomodguard
- gosec
- gosmopolitan
- loggercheck
- makezero
- musttag
- nilerr
- nilnesserr
- noctx
- perfsprint
- prealloc
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- testifylint
- unparam
- usestdlibvars
- whitespace
presets:
- bugs
- format
- import
- performance
- unused
#linters-settings:
# errcheck:
# check-type-assertions: true
run:
issues-exit-code: 1
tests: false
timeout: 10m
- zerologlint
disable:
- depguard
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- docs
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- docs
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion internal/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func copyResponse(req *dns.Msg, srcResp *dns.Msg, destResp *dns.Msg) {
return
}
// Copy relevant data from original request and source response into destination response
destResp.SetRcode(req, srcResp.MsgHdr.Rcode)
destResp.SetRcode(req, srcResp.Rcode)
destResp.RecursionDesired = req.RecursionDesired
destResp.RecursionAvailable = srcResp.RecursionAvailable
if srcResp.Ns != nil {
Expand Down
Loading