From 4f56e989e4fc849583a06fa4d1de9fc3daa99b48 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Tue, 1 Apr 2025 18:27:17 -0400 Subject: [PATCH] chore(golangci-lint): migrate configuration to v2 Signed-off-by: Chris Gianelloni --- .github/workflows/golangci-lint.yml | 7 +-- .golangci.yml | 93 ++++++++++++++++++++--------- internal/dns/dns.go | 2 +- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index d1b3347..bd6f151 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,7 +9,6 @@ on: permissions: contents: read - pull-requests: read jobs: golangci: @@ -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 diff --git a/.golangci.yml b/.golangci.yml index f70ee84..126f77f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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$ diff --git a/internal/dns/dns.go b/internal/dns/dns.go index a889e0b..aa68f4b 100644 --- a/internal/dns/dns.go +++ b/internal/dns/dns.go @@ -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 {