From 5263bfc2e19b3c24185ef024e06fff7f7b461dd9 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Mon, 14 Apr 2025 06:54:16 +0100 Subject: [PATCH] build: Update golangci-lint to v2.0.2 Various changes in this new major version, including a new config file format: - "gofmt" and "goimports" are now categorized as formatters (instead of linters) and are moved to their own section. - The functionality of "gosimple" has been bundled into "staticcheck". - "typecheck" is now always on and cannot be independently enabled/disabled. --- .github/workflows/go.yml | 2 +- .golangci.yml | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 813b7e2..fac73f3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,6 +17,6 @@ jobs: - name: Build run: go build ./... - name: Install Linters - run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5" + run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.2" - name: Test and Lint run: ./run_tests.sh diff --git a/.golangci.yml b/.golangci.yml index f05ef26..49a163b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,8 +1,8 @@ +version: "2" run: - deadline: 10m - + timeout: 10m linters: - disable-all: true + default: none enable: - asciicheck - bidichk @@ -17,9 +17,6 @@ linters: - fatcontext - goconst - godot - - gofmt - - goimports - - gosimple - govet - ineffassign - makezero @@ -34,9 +31,16 @@ linters: - revive - staticcheck - tparallel - - typecheck - unconvert - - usestdlibvars - - usetesting - unparam - unused + - usestdlibvars + - usetesting + exclusions: + presets: + - comments + - std-error-handling +formatters: + enable: + - gofmt + - goimports