mirror of
https://github.com/alexgo-io/gaze-indexer.git
synced 2026-01-12 08:34:28 +08:00
* feat: implement pagination on get balance, get holders * feat: paginate get transactions * fix: remove debug * feat: implement pagination in get utxos * feat: sort response in get holders * feat: cap batch query * feat: add default limits to all endpoints * chore: rename endpoint funcs * fix: parse rune name spacers * feat(runes): add get token list api * fix(runes): use distinct to get token list * feat: remove unused code * fix: count holders distinct pkscript * feat: implement additional scopes * chore: comments * feat: implement search * refactor: switch to use paginationRequest * refactor: rename get token list to get tokens * fix: count total holders by rune ids * fix: rename file * fix: rename minting to ongoing * fix: get ongoing check rune is mintable * chore: disable gosec g115 * fix: pr --------- Co-authored-by: Gaze <gazenw@users.noreply.github.com>
107 lines
4.1 KiB
YAML
107 lines
4.1 KiB
YAML
# GolangCI-Lint
|
|
# this workspace is using golangci-lint for linting, so you need to install it.
|
|
## MacOS Installation (HomeBrew)
|
|
# $ brew install golangci-lint
|
|
# See more: https://golangci-lint.run/usage/install/
|
|
## VSCode Integrations (for User Settings)
|
|
# 1. Open VSCode Settings (JSON)
|
|
# 2. in configs, add field `go.lintTool` and value `golangci-lint` ("go.lintTool":"golangci-lint")
|
|
# See more: https://golangci-lint.run/usage/integrations/
|
|
|
|
# See more: https://golangci-lint.run/usage/configuration/#run-configuration
|
|
run:
|
|
# Timeout for analysis, e.g. 30s, 5m.
|
|
# Default: 1m
|
|
timeout: 10m
|
|
# Include test files or not.
|
|
# Default: true
|
|
tests: false
|
|
# Allow multiple parallel golangci-lint instances running.
|
|
# If false (default) - golangci-lint acquires file lock on start.
|
|
allow-parallel-runners: false
|
|
|
|
# See more: https://golangci-lint.run/usage/linters/
|
|
linters:
|
|
disable-all: true
|
|
enable:
|
|
### Metalinter
|
|
- staticcheck # bugs, metalinter - https://staticcheck.io
|
|
- govet # bugs, metalinter
|
|
# - gocritic # style, metalinter - https://github.com/go-critic/go-critic
|
|
# - revive # style, metalinter - https://github.com/mgechev/revive
|
|
### Default Linters
|
|
- gosimple # style
|
|
- ineffassign # unused
|
|
- typecheck # bugs
|
|
- unused # unused
|
|
- errcheck # bugs, error
|
|
### If some linters are not needed or annoying, you can disable them here.
|
|
- bodyclose # performance, bugs - checks whether HTTP response body is closed successfully
|
|
- misspell # style, comment - Finds commonly misspelled English words in comments. https://github.com/client9/misspell
|
|
- durationcheck # bugs - check for two durations multiplied together
|
|
- gofumpt # format - Gofumpt checks whether code was gofumpt-ed.
|
|
- goimports # format, import - In addition to fixing imports, goimports also formats your code in the same style as gofmt.
|
|
- whitespace # style - Tool for detection of leading and trailing whitespace.
|
|
- nosprintfhostport # style - Checks for misuse of Sprintf to construct a host with port in a URL.
|
|
- usestdlibvars # style - detect the possibility to use variables/constants from the Go standard library
|
|
- noctx # performance, bugs - finds sending http request without context.Context
|
|
- goconst # style - Finds repeated strings that could be replaced by a constant
|
|
- errorlint # bugs, error - find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
|
|
- unconvert # style - unnecessary type conversions
|
|
- prealloc # performance - Find slice declarations that could potentially be pre-allocated, https://github.com/alexkohler/prealloc
|
|
- gosec # bugs - Inspects source code for security problems
|
|
- wrapcheck # style, error - Checks that errors returned from external packages are wrapped, we should wrap the error from external library
|
|
- depguard # import - Go linter that checks if package imports are in a list of acceptable packages.
|
|
- sloglint # style, format Ensure consistent code style when using log/slog.
|
|
### Annoying Linters
|
|
# - dupl # style - code clone detection
|
|
|
|
issues:
|
|
# Maximum issues count per one linter.
|
|
max-issues-per-linter: 50
|
|
# Maximum count of issues with the same text.
|
|
max-same-issues: 5
|
|
# Fix found issues (if it's supported by the linter).
|
|
fix: true
|
|
|
|
linters-settings:
|
|
misspell:
|
|
locale: US
|
|
ignore-words: []
|
|
errcheck:
|
|
exclude-functions:
|
|
- (github.com/jackc/pgx/v5.Tx).Rollback
|
|
wrapcheck:
|
|
ignoreSigs:
|
|
- .Errorf(
|
|
- errors.New(
|
|
- errors.Unwrap(
|
|
- errors.Join(
|
|
- .Wrap(
|
|
- .Wrapf(
|
|
- .WithMessage(
|
|
- .WithMessagef(
|
|
- .WithStack(
|
|
- errs.NewPublicError(
|
|
- errs.WithPublicMessage(
|
|
- withstack.WithStackDepth(
|
|
ignoreSigRegexps:
|
|
- \.New.*Error\(
|
|
goconst:
|
|
ignore-tests: true
|
|
min-occurrences: 5
|
|
depguard:
|
|
rules:
|
|
main:
|
|
# Packages that are not allowed.
|
|
deny:
|
|
- pkg: "github.com/pkg/errors"
|
|
desc: Should be replaced by "cockroachdb/errors" or "cleverse/go-utilities" package
|
|
sloglint:
|
|
attr-only: true
|
|
key-naming-case: snake
|
|
args-on-sep-lines: true
|
|
gosec:
|
|
excludes:
|
|
- G115
|