2019-10-07 15:35:32 +00:00
|
|
|
run:
|
|
|
|
# timeout for analysis
|
|
|
|
deadline: 4m
|
|
|
|
|
2022-05-20 06:56:21 +00:00
|
|
|
skip-files:
|
|
|
|
- "\\.pb\\.go$"
|
|
|
|
- "\\.pb\\.gw\\.go$"
|
2019-10-07 15:35:32 +00:00
|
|
|
|
|
|
|
linters-settings:
|
2022-05-20 06:56:21 +00:00
|
|
|
govet:
|
|
|
|
# Don't report about shadowed variables
|
|
|
|
check-shadowing: false
|
|
|
|
|
2019-10-07 15:35:32 +00:00
|
|
|
gofmt:
|
|
|
|
# simplify code: gofmt with `-s` option, true by default
|
|
|
|
simplify: true
|
|
|
|
|
2022-05-20 06:56:21 +00:00
|
|
|
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"]
|
|
|
|
|
2019-10-07 15:35:32 +00:00
|
|
|
linters:
|
|
|
|
enable-all: true
|
|
|
|
disable:
|
2022-05-20 06:56:21 +00:00
|
|
|
# Global variables are used in many places throughout the code base.
|
2019-10-07 15:35:32 +00:00
|
|
|
- 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
|
|
|
|
|
2022-05-20 06:56:21 +00:00
|
|
|
# We want to allow short variable names.
|
|
|
|
- varnamelen
|
|
|
|
|
|
|
|
# We want to allow TODOs.
|
|
|
|
- godox
|
2019-10-07 15:35:32 +00:00
|
|
|
|
|
|
|
# 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
|
2022-05-20 06:56:21 +00:00
|
|
|
# yet. Enabling by default for example, would also force new contributors to
|
2019-10-07 15:35:32 +00:00
|
|
|
# potentially extensively refactor code, when they want to smaller change to
|
|
|
|
# land.
|
|
|
|
- gocyclo
|
2022-05-20 06:56:21 +00:00
|
|
|
- gocognit
|
|
|
|
- cyclop
|
2019-10-07 15:35:32 +00:00
|
|
|
|
|
|
|
# Instances of table driven tests that don't pre-allocate shouldn't trigger
|
|
|
|
# the linter.
|
|
|
|
- prealloc
|
|
|
|
|
2019-10-28 16:06:16 +00:00
|
|
|
# Init functions are used by loggers throughout the codebase.
|
|
|
|
- gochecknoinits
|
2022-05-20 06:56:21 +00:00
|
|
|
|
|
|
|
# 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
|
2023-09-28 11:16:01 +00:00
|
|
|
- varcheck
|
|
|
|
- structcheck
|
|
|
|
- deadcode
|
2022-05-20 06:56:21 +00:00
|
|
|
|
|
|
|
# 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
|
2022-12-15 15:43:38 +00:00
|
|
|
- revive
|
2023-09-28 11:16:01 +00:00
|
|
|
- tagalign
|
|
|
|
- depguard
|
|
|
|
- nosnakecase
|
|
|
|
- interfacebloat
|
2022-12-15 15:43:38 +00:00
|
|
|
|
2022-05-20 06:56:21 +00:00
|
|
|
# Additions compared to LND
|
|
|
|
- exhaustruct
|
2019-10-28 16:06:16 +00:00
|
|
|
|
2019-10-07 15:35:32 +00:00
|
|
|
issues:
|
|
|
|
# Only show newly introduced problems.
|
|
|
|
new-from-rev: 36838cf7f464cf73b0201798063b2caffeae4250
|
2022-05-20 06:56:21 +00:00
|
|
|
|
|
|
|
exclude-rules:
|
|
|
|
|
|
|
|
# Allow fmt.Printf() in test files
|
|
|
|
- path: _test\.go
|
|
|
|
linters:
|
|
|
|
- forbidigo
|
2022-12-15 15:43:38 +00:00
|
|
|
- unparam
|
2023-09-28 11:16:01 +00:00
|
|
|
- gosec
|
|
|
|
- path: _mock\.go
|
|
|
|
linters:
|
|
|
|
- gosec
|
2022-05-20 06:56:21 +00:00
|
|
|
|
|
|
|
# Allow fmt.Printf() in loopd
|
|
|
|
- path: cmd/loopd/*
|
|
|
|
linters:
|
|
|
|
- forbidigo
|
|
|
|
- path: loopd/*
|
|
|
|
linters:
|
|
|
|
- forbidigo
|
|
|
|
|
|
|
|
# Allow fmt.Printf() in loop
|
|
|
|
- path: cmd/loop/*
|
2023-08-23 09:27:23 +00:00
|
|
|
linters:
|
|
|
|
- forbidigo
|
|
|
|
|
|
|
|
# Allow fmt.Printf() in stateparser
|
|
|
|
- path: fsm/stateparser/*
|
2022-05-20 06:56:21 +00:00
|
|
|
linters:
|
|
|
|
- forbidigo
|