Files
gocryptotrader/.golangci.yml
Gareth Kirwan 1199f38546 subscriptions: Encapsulate, replace Pair with Pairs and refactor; improve exchange support
* Websocket: Use ErrSubscribedAlready

instead of errChannelAlreadySubscribed

* Subscriptions: Replace Pair with Pairs

Given that some subscriptions have multiple pairs, support that as the
standard.

* Docs: Update subscriptions in add new exch

* RPC: Update Subscription Pairs

* Linter: Disable testifylint.Len

We deliberately use Equal over Len to avoid spamming the contents of large Slices

* Websocket: Add suffix to state consts

* Binance: Subscription Pairs support

* Bitfinex: Subscription Pairs support

* Bithumb: Subscription Pairs support

* Bitmex: Subscription Pairs support

* Bitstamp: Subscription Pairs support

* BTCMarkets: Subscription Pairs support

* BTSE: Subscription Pairs support

* Coinbase: Subscription Pairs support

* Coinut: Subscription Pairs support

* GateIO: Subscription Pairs support

* Gemini: Subscription Pairs support and improvement

* Hitbtc: Subscription Pairs support

* Huboi: Subscription Pairs support

* Kucoin: Subscription Pairs support

* Okcoin: Subscription Pairs support

* Poloniex: Subscription Pairs support

* Kraken: Add subscription Pairs support

Note: This is a naieve implementation because we want to rebase the
kraken websocket rewrite on top of this

* Bybit: Subscription Pairs support

* Okx: Subscription Pairs support

* Bitmex: Subsription configuration

* Fixes unauthenticated websocket left as CanUseAuth
* Fixes auth subs happening privately

* CoinbasePro: Subscription Configuration

* Consolidate ProductIDs when all subscriptions are for the same list

* Websocket: Log actual sent message when Verbose

* Subscriptions: Improve clarity of which key is which in Match

* Subscriptions: Lint fix for HugeParam

* Subscriptions: Add AddPairs and move keys from test

* Subscriptions: Simplify subscription keys and add key types

* Subscriptions: Add List.GroupPairs Rename sub.AddPairs

* Subscription: Fix ExactKey not matching 0 pairs

* Subscriptions: Remove unused IdentityKey and HasPairKey

* Subscriptions: Fix GetKey test

* Subscriptions: Test coverage improvements

* Websocket: Change State on Add/Remove

* Subscriptions: Improve error context

* Subscriptions: Fix Enable: false subs not ignored

* Bitfinex: Fix WsAuth test failing on DataHandler

DataHandler is eaten by dataMonitor now, so we need to use ToRoutine

* Deribit: Subscription Pairs support

* Websocket: Accept nil lists for checkSubscriptions

If the user passes in a nil (implicitly empty) list, we would not panic.
Therefore the burden of correctness about that data lies with them.
The list of subscriptions is empty, and that's okay, and possibly
convenient

* Websocket: Add context to NilPointer errors

* Subscriptions: Add context to nil errors

* Exchange: Fix error expectations in UnsubToWSChans
2024-06-07 11:54:08 +10:00

172 lines
3.7 KiB
YAML

run:
timeout: 10m
issues-exit-code: 1
tests: true
skip-dirs:
- vendor
- web/
- testdata
- database/models/
linters:
disable-all: true
enable:
# defaults
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
# - unused
# disabled by default linters
# - asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
# - contextcheck
# - cyclop
# - deadcode // abandoned by its owner, replaced by unused
- decorder
# - depguard
- dogsled
# - dupl
- dupword
- durationcheck
- errchkjson
- errname
# - errorlint
- execinquery
# - exhaustive
# - exhaustivestruct // abandoned by its owner, replaced by exhaustruct
# - exhaustruct
- exportloopref
# - forbidigo
- forcetypeassert
# - funlen
- gci
# - ginkgolinter
- gocheckcompilerdirectives
# - gochecknoglobals
# - gochecknoinits
- gochecksumtype
# - gocognit
- goconst
- gocritic
# - gocyclo
# - godot
# - godox
# - goerr113
- gofmt
# - gofumpt
# - goheader
- goimports
# - golint // deprecated since 1.41.0, replaced by revive
# - gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
# - gosmopolitan
- grouper
# - ifshort // deprecated by its owner
# - importas
# - inamedparam
# - interfacebloat
# - interfacer // deprecated by its owner
# - ireturn
# - lll
# - loggercheck
# - maintidx
- makezero
# - maligned // deprecated by its owner, replaced by govet 'fieldalignment'
- mirror
- misspell
# - musttag
# - nakedret
# - nestif
- nilerr
# - nilnil
# - nlreturn
- noctx
- nolintlint
# - nonamedreturns
# - nosnakecase // deprecated by its owner, replaced by revive 'var-naming'
- nosprintfhostport
# - paralleltest
- perfsprint
- prealloc
- predeclared
# - promlinter
# - protogetter
- reassign
- revive
- rowserrcheck
# - scopelint // deprecated since v1.39.0, replaced by exportloopref
- sqlclosecheck
# - structcheck // abandoned by its owner, replaced by unused
- stylecheck
- tagalign
# - tagliatelle
- tenv
- testableexamples
- testifylint
# - testpackage
- thelper
- tparallel
- unconvert
- unparam
- usestdlibvars
# - varcheck // abandoned by its owner, replaced by unused
# - varnamelen
- wastedassign
- whitespace
# - wrapcheck
# - wsl
# - zerologlint
linters-settings:
govet:
check-shadowing: true
goconst:
min-occurrences: 6
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
- importShadow
- methodExprCall
- evalOrder
testifylint:
enable-all: true
disable:
- require-error
- float-compare
# We deliberately use Equal over Len to avoid spamming the contents of large Slices
- len
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
- text: "Expect WriteFile permissions to be 0600 or less"
linters:
- gosec
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
# The following silences false positives in table tests
# https://github.com/kyoh86/scopelint/issues/4
- Using the variable on range scope `ti` in function literal
include:
- EXC0012 # revive: Comment exported (.+) should have comment( \(or a comment on this block\))? or be unexported
- EXC0014 # revive: Comment on exported (.+) should be of the form "(.+)..."