From fa2ae3a47218ee84b6eb5d4ef6a8a4d8145dd5ca Mon Sep 17 00:00:00 2001 From: Akshay Kalia Date: Sun, 7 Jun 2026 21:47:06 -0400 Subject: [PATCH] chore: modernize golangci-lint config - Replace dead .golangci.yml.old with active .golangci.yml (v2 format) - Enable additional linters that pass cleanly: bodyclose, misspell, nilerr, unconvert, wastedassign - Update CI from golangci-lint v1.56 (EOL) to v2.1 - Update action from golangci-lint-action@v3 to @v6 All new linters produce zero findings on the current codebase. They catch HTTP body leaks (bodyclose), swallowed errors (nilerr), typos (misspell), and dead assignments (wastedassign) in future code. --- .github/workflows/tests.yaml | 4 ++-- .golangci.yml | 28 ++++++++++++++++++++++++++++ .golangci.yml.old | 17 ----------------- 3 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 .golangci.yml delete mode 100644 .golangci.yml.old diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ba21fea..32ab5e0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,7 +47,7 @@ jobs: cache: true - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v7 with: - version: v1.56 + version: v2.1 args: --timeout=5m --issues-exit-code=0 diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..d397ec1 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,28 @@ +version: "2" + +linters: + default: none + enable: + - bodyclose + - errcheck + - govet + - ineffassign + - misspell + - nilerr + - staticcheck + - unconvert + - unused + - wastedassign + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + rules: + - linters: + - nilerr + - staticcheck + - unused + path: _test\.go diff --git a/.golangci.yml.old b/.golangci.yml.old deleted file mode 100644 index 207a33a..0000000 --- a/.golangci.yml.old +++ /dev/null @@ -1,17 +0,0 @@ -linters: - enable: - - errcheck - - govet - - ineffassign - - staticcheck - - unused - -issues: - exclude-rules: - - path: _test\.go - linters: - - staticcheck - - unused - -run: - allow-parallel-runners: true \ No newline at end of file