mirror of
https://github.com/lightninglabs/loop
synced 2024-11-08 01:10:29 +00:00
4baf88c414
This commit fixes outstanding linter issues, that we're not found by running `make lint` locally. The linter issues were found by running `docker run -v $(pwd):/build loop-tools golangci-lint run --whole-files` I added the `revive` to the excludes as it would be to much of a refactor and IMO seems unneccesary. E.g. `interface.go:222:6: exported: type name will be used as loop.LoopInTerms by other packages, and that stutters; consider calling this InTerms (revive)`. I think `loop.LoopInTerms` is fine.
137 lines
2.8 KiB
YAML
137 lines
2.8 KiB
YAML
run:
|
|
# timeout for analysis
|
|
deadline: 4m
|
|
|
|
skip-files:
|
|
- "\\.pb\\.go$"
|
|
- "\\.pb\\.gw\\.go$"
|
|
|
|
linters-settings:
|
|
govet:
|
|
# Don't report about shadowed variables
|
|
check-shadowing: false
|
|
|
|
gofmt:
|
|
# simplify code: gofmt with `-s` option, true by default
|
|
simplify: true
|
|
|
|
tagliatelle:
|
|
case:
|
|
rules:
|
|
json: snake
|
|
|
|
whitespace:
|
|
multi-func: true
|
|
multi-if: true
|
|
|
|
gosec:
|
|
excludes:
|
|
- G402 # Look for bad TLS connection settings.
|
|
- G306 # Poor file permissions used when writing to a new file.
|
|
|
|
staticcheck:
|
|
go: "1.18"
|
|
checks: ["-SA1019"]
|
|
|
|
linters:
|
|
enable-all: true
|
|
disable:
|
|
# Global variables are used in many places throughout the code base.
|
|
- gochecknoglobals
|
|
|
|
# Some lines are over 80 characters on purpose and we don't want to make them
|
|
# even longer by marking them as 'nolint'.
|
|
- lll
|
|
|
|
# We want to allow short variable names.
|
|
- varnamelen
|
|
|
|
# We want to allow TODOs.
|
|
- godox
|
|
|
|
# We have long functions, especially in tests. Moving or renaming those would
|
|
# trigger funlen problems that we may not want to solve at that time.
|
|
- funlen
|
|
|
|
# Disable for now as we haven't yet tuned the sensitivity to our codebase
|
|
# yet. Enabling by default for example, would also force new contributors to
|
|
# potentially extensively refactor code, when they want to smaller change to
|
|
# land.
|
|
- gocyclo
|
|
- gocognit
|
|
- cyclop
|
|
|
|
# Instances of table driven tests that don't pre-allocate shouldn't trigger
|
|
# the linter.
|
|
- prealloc
|
|
|
|
# Init functions are used by loggers throughout the codebase.
|
|
- gochecknoinits
|
|
|
|
# Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19.
|
|
- errorlint
|
|
|
|
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
|
|
- interfacer
|
|
- golint
|
|
- maligned
|
|
- scopelint
|
|
|
|
# New linters that need a code adjustment first.
|
|
- wrapcheck
|
|
- nolintlint
|
|
- paralleltest
|
|
- tparallel
|
|
- testpackage
|
|
- gofumpt
|
|
- gomoddirectives
|
|
- ireturn
|
|
- maintidx
|
|
- nlreturn
|
|
- dogsled
|
|
- gci
|
|
- containedctx
|
|
- contextcheck
|
|
- errname
|
|
- exhaustivestruct
|
|
- goerr113
|
|
- gomnd
|
|
- ifshort
|
|
- noctx
|
|
- nestif
|
|
- wsl
|
|
- exhaustive
|
|
- forcetypeassert
|
|
- nilerr
|
|
- nilnil
|
|
- stylecheck
|
|
- thelper
|
|
- revive
|
|
|
|
# Additions compared to LND
|
|
- exhaustruct
|
|
|
|
issues:
|
|
# Only show newly introduced problems.
|
|
new-from-rev: 36838cf7f464cf73b0201798063b2caffeae4250
|
|
|
|
exclude-rules:
|
|
|
|
# Allow fmt.Printf() in test files
|
|
- path: _test\.go
|
|
linters:
|
|
- forbidigo
|
|
- unparam
|
|
|
|
# Allow fmt.Printf() in loopd
|
|
- path: cmd/loopd/*
|
|
linters:
|
|
- forbidigo
|
|
- path: loopd/*
|
|
linters:
|
|
- forbidigo
|
|
|
|
# Allow fmt.Printf() in loop
|
|
- path: cmd/loop/*
|
|
linters:
|
|
- forbidigo |