From d3f8ae94e54309236345deba78453007bacd4b57 Mon Sep 17 00:00:00 2001 From: William Martin Date: Mon, 16 Jun 2025 17:50:43 +0200 Subject: [PATCH 1/2] Bump golangci-lint to v2 --- .github/workflows/lint.yml | 22 ++++++---------------- .golangci.yml | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f1ae1e522a4..76ef01a14da 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,17 +27,7 @@ jobs: with: go-version-file: 'go.mod' - - name: Verify dependencies - run: | - go mod verify - go mod download - - LINT_VERSION=1.63.4 - curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \ - tar xz --strip-components 1 --wildcards \*/golangci-lint - mkdir -p bin && mv golangci-lint bin/ - - - name: Run checks + - name: Ensure go.mod and go.sum are up to date run: | STATUS=0 assert-nothing-changed() { @@ -49,10 +39,10 @@ jobs: STATUS=1 fi } - - assert-nothing-changed go fmt ./... assert-nothing-changed go mod tidy - - bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$? - exit $STATUS + + - name: golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 + with: + version: v2.1.6 diff --git a/.golangci.yml b/.golangci.yml index ff7f3701405..861198dd8f9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,17 @@ +version: "2" + linters: enable: - - gofmt - - nolintlint + - nolintlint + disable: + # The following linters are disabled purely because this config was migrated to v2 where they are in the default + # set, and we should have separate work to enable them if we truly want them. + - staticcheck + - errcheck + +formatters: + enable: + - gofmt issues: max-issues-per-linter: 0 From ce8b9d5c3c713c1404b6fb99cfa806b923a37c4d Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 17 Jun 2025 09:56:50 +0200 Subject: [PATCH 2/2] Update .github/workflows/lint.yml Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 76ef01a14da..48e8539d185 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,6 +43,6 @@ jobs: exit $STATUS - name: golangci-lint - uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 with: version: v2.1.6