From c5e9e67a4c623b09751bdce0242b982f4d50b644 Mon Sep 17 00:00:00 2001 From: Pete Davison Date: Wed, 26 Mar 2025 22:55:38 +0000 Subject: [PATCH] feat: migrate to golangci-lint v2 --- .golangci.yml | 74 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d0953fe9..7b82d800 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,38 +1,56 @@ -# NOTE(@andreynering): The linters listed here are additions on top of -# those enabled by default: -# -# https://golangci-lint.run/usage/linters/#enabled-by-default +version: "2" + +formatters: + enable: + - gofmt + - gofumpt + - goimports + settings: + gofmt: + rewrite-rules: + - pattern: interface{} + replacement: any + gofumpt: + module-path: github.com/go-task/task/v3 + goimports: + local-prefixes: + - github.com/go-task + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ linters: enable: - depguard - - goimports - - gofmt - - gofumpt - mirror - misspell - noctx - paralleltest - - usetesting - thelper - tparallel - -linters-settings: - depguard: - rules: - main: - files: - - "$all" - - "!$test" - - "!**/errors/*.go" - deny: - - pkg: "errors" - desc: "Use github.com/go-task/task/v3/errors instead" - goimports: - local-prefixes: github.com/go-task - gofumpt: - module-path: github.com/go-task/task/v3 - gofmt: - rewrite-rules: - - pattern: 'interface{}' - replacement: 'any' + - usetesting + settings: + depguard: + rules: + main: + files: + - $all + - '!$test' + - '!**/errors/*.go' + deny: + - pkg: errors + desc: Use github.com/go-task/task/v3/errors instead + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$