Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

env:
GOLANGCI_LINT_VERSION: v1.64.5
GOLANGCI_LINT_VERSION: v2.0.2

jobs:
test:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
- name: tidy
Expand Down
227 changes: 105 additions & 122 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,157 +1,140 @@
run:
timeout: 5m

version: "2"
issues:
max-issues-per-linter: 0
max-same-issues: 0
uniq-by-line: true
exclude-rules:
- path: _test\.go
linters:
- bodyclose
- dupl
- errcheck
- errorlint
- funlen
- goconst
- gocyclo
- goerr113
- gosec
- lll
- noctx
- prealloc
- unparam

output:
sort-results: true

formatters:
enable:
- gofmt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/sumup/typeid)
- dot
gofmt:
simplify: true
goimports:
local-prefixes:
- github.com/sumup/typeid
linters:
disable-all: true
default: none
enable:
- asciicheck
- depguard
- durationcheck
- errcheck
- errorlint
- exhaustive
- gocritic
- gofmt
- goimports
- gomoddirectives
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- makezero
- megacheck
- misspell
- nakedret
- nakedret
- nilerr
- noctx
- nolintlint
- prealloc
- revive
- staticcheck
- stylecheck
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- usestdlibvars
- unused
- usestdlibvars
- wastedassign
- whitespace

linters-settings:
depguard:
rules:
main:
deny:
- pkg: github.com/pkg/errors
desc: Use "errors" from std lib instead.
- pkg: golang.org/x/exp/slices
desc: Use "slices" from std lib instead.
- pkg: golang.org/x/exp/maps
desc: Use "maps" from std lib instead.
errorlint:
errorf: true
asserts: false
comparison: true
errcheck:
check-type-assertions: true
check-blank: false
exhaustive:
default-signifies-exhaustive: true
gci:
sections:
- standard
- default
- prefix(github.com/sumup/typeid)
- dot
skip-generated: false
gocritic:
disabled-checks:
- sloppyReassign
- whyNoLint
enabled-tags:
- diagnostic
- style
- performance
settings:
hugeParam:
sizeThreshold: 512
gofmt:
simplify: true
goimports:
local-prefixes: github.com/sumup/typeid
gomoddirectives:
replace-local: true
gosimple:
checks: ["all"]
govet:
enable-all: true
disable:
- fieldalignment
nakedret:
max-func-lines: 10
misspell:
locale: US
prealloc:
simple: true
range-loops: true
for-loops: false
revive:
settings:
errcheck:
check-type-assertions: true
check-blank: false
errorlint:
errorf: true
asserts: false
comparison: true
exhaustive:
default-signifies-exhaustive: true
gocritic:
disabled-checks:
- sloppyReassign
- whyNoLint
enabled-tags:
- diagnostic
- style
- performance
settings:
hugeParam:
sizeThreshold: 512
gomoddirectives:
replace-local: true
govet:
disable:
- fieldalignment
enable-all: true
misspell:
locale: US
nakedret:
max-func-lines: 10
nolintlint:
require-explanation: true
require-specific: true
allow-unused: false
prealloc:
simple: true
range-loops: true
for-loops: false
revive:
rules:
- name: blank-imports
disabled: true
staticcheck:
checks:
- all
testifylint:
enable:
- bool-compare
- compares
- empty
- error-is-as
- error-nil
- expected-actual
- float-compare
- len
- suite-dont-use-pkg
- suite-extra-assert-call
- suite-thelper
unparam:
check-exported: false
whitespace:
multi-if: false
multi-func: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: blank-imports
disabled: true
nolintlint:
allow-unused: false
require-explanation: true
require-specific: true
staticcheck:
checks: ['all']
stylecheck:
checks: ['all']
unparam:
check-exported: false
unused: {}
whitespace:
multi-if: false
multi-func: false
testifylint:
enable:
- bool-compare
- compares
- empty
- error-is-as
- error-nil
- expected-actual
- float-compare
- len
- suite-dont-use-pkg
- suite-extra-assert-call
- suite-thelper
- linters:
- bodyclose
- dupl
- err113
- errcheck
- errorlint
- funlen
- goconst
- gocyclo
- gosec
- lll
- noctx
- prealloc
- unparam
path: _test\.go