lint+tools: bump version of golangci-lint
This commit is contained in:
3 files changed
+1287
-145
No files matched your search
+95
-4
@@ -20,6 +20,8 @@ run:
|
|||||||
- signrpc
|
- signrpc
|
||||||
- walletrpc
|
- walletrpc
|
||||||
- watchtowerrpc
|
- watchtowerrpc
|
||||||
|
- kvdb_etcd
|
||||||
|
- kvdb_postgres
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
@@ -28,6 +30,20 @@ linters-settings:
|
|||||||
gofmt:
|
gofmt:
|
||||||
# simplify code: gofmt with `-s` option, true by default
|
# simplify code: gofmt with `-s` option, true by default
|
||||||
simplify: true
|
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.16"
|
||||||
|
checks: ["-SA1019"]
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
@@ -39,18 +55,23 @@ linters:
|
|||||||
# even longer by marking them as 'nolint'.
|
# even longer by marking them as 'nolint'.
|
||||||
- lll
|
- lll
|
||||||
|
|
||||||
# We don't care (enough) about misaligned structs to lint that.
|
# We want to allow short variable names.
|
||||||
- maligned
|
- varnamelen
|
||||||
|
|
||||||
|
# We want to allow TODOs.
|
||||||
|
- godox
|
||||||
|
|
||||||
# We have long functions, especially in tests. Moving or renaming those would
|
# 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.
|
# trigger funlen problems that we may not want to solve at that time.
|
||||||
- funlen
|
- funlen
|
||||||
|
|
||||||
# Disable for now as we haven't yet tuned the sensitivity to our codebase
|
# 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
|
# yet. Enabling by default for example, would also force new contributors to
|
||||||
# potentially extensively refactor code, when they want to smaller change to
|
# potentially extensively refactor code, when they want to smaller change to
|
||||||
# land.
|
# land.
|
||||||
- gocyclo
|
- gocyclo
|
||||||
|
- gocognit
|
||||||
|
- cyclop
|
||||||
|
|
||||||
# Instances of table driven tests that don't pre-allocate shouldn't trigger
|
# Instances of table driven tests that don't pre-allocate shouldn't trigger
|
||||||
# the linter.
|
# the linter.
|
||||||
@@ -58,9 +79,49 @@ linters:
|
|||||||
|
|
||||||
# Init functions are used by loggers throughout the codebase.
|
# Init functions are used by loggers throughout the codebase.
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
|
|
||||||
|
# Causes stack overflow, see https://github.com/polyfloyd/go-errorlint/issues/19.
|
||||||
|
- errorlint
|
||||||
|
|
||||||
# interfacer has been archived.
|
# Has an issue (https://github.com/ultraware/whitespace/issues/6) but will
|
||||||
|
# want to enable this in the future.
|
||||||
|
- whitespace
|
||||||
|
|
||||||
|
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
|
||||||
- interfacer
|
- 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
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
# Only show newly introduced problems.
|
# Only show newly introduced problems.
|
||||||
@@ -72,6 +133,36 @@ issues:
|
|||||||
- path: _test\.go
|
- path: _test\.go
|
||||||
linters:
|
linters:
|
||||||
- gosec
|
- gosec
|
||||||
|
- path: test*
|
||||||
|
linters:
|
||||||
|
- gosec
|
||||||
|
|
||||||
|
# Allow duplicated code and fmt.Printf() in DB migrations.
|
||||||
|
- path: channeldb/migration*
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- forbidigo
|
||||||
|
- godot
|
||||||
|
|
||||||
|
# Allow duplicated code and fmt.Printf() in DB migration tests.
|
||||||
|
- path: channeldb/migtest
|
||||||
|
linters:
|
||||||
|
- dupl
|
||||||
|
- forbidigo
|
||||||
|
- godot
|
||||||
|
|
||||||
|
# Allow fmt.Printf() in lncli.
|
||||||
|
- path: cmd/lncli/*
|
||||||
|
linters:
|
||||||
|
- forbidigo
|
||||||
|
|
||||||
|
# Allow fmt.Printf() in config parsing.
|
||||||
|
- path: config\.go
|
||||||
|
linters:
|
||||||
|
- forbidigo
|
||||||
|
- path: lnd\.go
|
||||||
|
linters:
|
||||||
|
- forbidigo
|
||||||
|
|
||||||
# Fix false positives because of build flags in itest directory.
|
# Fix false positives because of build flags in itest directory.
|
||||||
- path: lntest/itest/.*
|
- path: lntest/itest/.*
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ require (
|
|||||||
github.com/btcsuite/btcd v0.22.0-beta.0.20211005184431-e3449998be39
|
github.com/btcsuite/btcd v0.22.0-beta.0.20211005184431-e3449998be39
|
||||||
github.com/dvyukov/go-fuzz v0.0.0-20210602112143-b1f3d6f4ef4e
|
github.com/dvyukov/go-fuzz v0.0.0-20210602112143-b1f3d6f4ef4e
|
||||||
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
|
github.com/elazarl/go-bindata-assetfs v1.0.1 // indirect
|
||||||
github.com/golangci/golangci-lint v1.18.0
|
github.com/golangci/golangci-lint v1.44.0
|
||||||
github.com/ory/go-acc v0.2.6
|
github.com/ory/go-acc v0.2.6
|
||||||
github.com/rinchsan/gosimports v0.1.5
|
github.com/rinchsan/gosimports v0.1.5
|
||||||
github.com/stephens2424/writerset v1.0.2 // indirect
|
github.com/stephens2424/writerset v1.0.2 // indirect
|
||||||
|
|||||||
+1191
-140
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user