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.
This commit is contained in:
jholdstock 2025-04-14 06:54:16 +01:00 committed by Jamie Holdstock
parent 30dcf49c62
commit 5263bfc2e1
2 changed files with 14 additions and 10 deletions

View File

@ -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

View File

@ -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