Files
gocryptotrader/.golangci.yml
Adrian Gallagher 7ebc392532 build/linters: Bump Go to v1.25 and golangci-lint to v2.4.0 (#2005)
* build/linters: Bump Go to v1.25 and golangci-lint to v2.4.0

* refactor: Update TODO comments for net.Listen and net.DialTimeout; improve variable naming in websocket and exchange methods

* refactor: Rename massageMissingData to backfillMissingData for clarity and update references in RSI and MFI calculations

* fix: Correct typo in TODO comment for net.Listen in RPC server
2025-08-20 11:55:15 +10:00

211 lines
4.0 KiB
YAML

version: "2"
run:
issues-exit-code: 1
tests: true
linters:
default: none
enable:
# defaults
- errcheck
- govet
- ineffassign
- staticcheck
- unused
# disabled by default linters
# - arangolint
# - asasalint
- asciicheck
- bidichk
- bodyclose
# - canonicalheader
- containedctx
# - contextcheck
- copyloopvar
# - cyclop
- decorder
- depguard
- dogsled
# - dupl
- dupword
- durationcheck
# - embeddedstructfieldcheck
# - err113
- errchkjson
- errname
# - errorlint
# - exhaustive
# - exhaustruct
# - exptostd
- fatcontext
# - forbidigo
- forcetypeassert
# - funcorder
# - funlen
# - ginkgolinter
- gocheckcompilerdirectives
# - gochecknoglobals
# - gochecknoinits
- gochecksumtype
# - gocognit
- goconst
- gocritic
# - gocyclo
# - godot
# - godox
# - goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
# - gosmopolitan
- grouper
- iface
# - importas
# - inamedparam
# - interfacebloat
- intrange
# - ireturn
# - lll
# - loggercheck
# - maintidx
- makezero
- mirror
- misspell
# - mnd
# - musttag
# - nakedret
# - nestif
- nilerr
- nilnesserr
# - nilnil
# - nlreturn
- noctx
# - noinlineerr
- nolintlint
# - nonamedreturns
- nosprintfhostport
# - paralleltest
- perfsprint
- prealloc
- predeclared
# - promlinter
# - protogetter
- reassign
# - recvcheck
- revive
- rowserrcheck
# - sloglint
# - spancheck
- sqlclosecheck
- tagalign
# - tagliatelle
- testableexamples
- testifylint
# - testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
- usetesting
# - varnamelen
- wastedassign
- whitespace
# - wrapcheck
# - wsl_v5
# - zerologlint
# - wsl // Deprecated
settings:
depguard:
rules:
prevent_json_package_use:
list-mode: lax
files:
- $all
allow:
- github.com/thrasher-corp/gocryptotrader/encoding/json
deny:
- pkg: encoding/json
desc: Please use the custom JSON package github.com/thrasher-corp/gocryptotrader/encoding/json instead of encoding/json to allow sonic/json switching.
goconst:
min-occurrences: 6
gocritic:
disabled-checks:
- wrapperFunc
- methodExprCall
- evalOrder
enabled-tags:
- performance
- style
- experimental
govet:
enable:
- shadow
- nilness
- unusedwrite
staticcheck:
checks:
- all
- '-ST1000' # Disable at least one file in a package should have a package comment check
- '-QF1005' # Disable expand call to math.Pow check
- '-QF1008' # Disable embedded field from selector check
testifylint:
enable-all: true
disable:
- require-error
- float-compare
# We deliberately use Equal over Len to avoid spamming the contents of large Slices
- len
exclusions:
generated: lax
presets:
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- gosec
text: Expect WriteFile permissions to be 0600 or less
- linters:
- govet
text: 'shadow: declaration of "err" shadows declaration at'
- linters:
- revive
text: 'should have a package comment'
- linters:
- revive
text: "var-naming: avoid meaningless package names"
paths:
- vendor
- web/
- testdata
- database/models/
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- vendor
- web/
- testdata
- database/models/
- third_party$
- builtin$
- examples$