lint+tools: bump version of golangci-lint

This commit is contained in:
Oliver Gugger 2022-02-07 13:58:24 +01:00
parent 192cee494f
commit 369627901f
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
3 changed files with 1287 additions and 145 deletions

View File

@ -20,6 +20,8 @@ run:
- signrpc
- walletrpc
- watchtowerrpc
- kvdb_etcd
- kvdb_postgres
linters-settings:
govet:
@ -28,6 +30,20 @@ linters-settings:
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.16"
checks: ["-SA1019"]
linters:
enable-all: true
@ -39,18 +55,23 @@ linters:
# even longer by marking them as 'nolint'.
- lll
# We don't care (enough) about misaligned structs to lint that.
- maligned
# 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
# 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.
@ -58,9 +79,49 @@ linters:
# Init functions are used by loggers throughout the codebase.
- 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
- 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:
# Only show newly introduced problems.
@ -72,6 +133,36 @@ issues:
- path: _test\.go
linters:
- 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.
- path: lntest/itest/.*

View File

@ -6,7 +6,7 @@ require (
github.com/btcsuite/btcd v0.22.0-beta.0.20211005184431-e3449998be39
github.com/dvyukov/go-fuzz v0.0.0-20210602112143-b1f3d6f4ef4e
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/rinchsan/gosimports v0.1.5
github.com/stephens2424/writerset v1.0.2 // indirect

File diff suppressed because it is too large Load Diff