mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 13:42:49 +02:00
.golangci: Replace lll with custom ll
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,6 +44,9 @@ cmd/cmd
|
|||||||
*.key
|
*.key
|
||||||
*.hex
|
*.hex
|
||||||
|
|
||||||
|
# Ignore the custom linter binary if it is built.
|
||||||
|
custom-gcl
|
||||||
|
|
||||||
cmd/lncli/lncli
|
cmd/lncli/lncli
|
||||||
|
|
||||||
# Files from mobile build.
|
# Files from mobile build.
|
||||||
|
@@ -20,6 +20,18 @@ run:
|
|||||||
- integration
|
- integration
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
|
custom:
|
||||||
|
ll:
|
||||||
|
type: "module"
|
||||||
|
description: "Custom lll linter with 'S' log line exclusion."
|
||||||
|
settings:
|
||||||
|
# Max line length, lines longer will be reported.
|
||||||
|
line-length: 80
|
||||||
|
# Tab width in spaces.
|
||||||
|
tab-width: 8
|
||||||
|
# The regex that we will use to detect the start of an `S` log line.
|
||||||
|
log-regex: "^\\s*.*(L|l)og\\.(Info|Debug|Trace|Warn|Error|Critical)S\\("
|
||||||
|
|
||||||
errorlint:
|
errorlint:
|
||||||
# Check for incorrect fmt.Errorf error wrapping.
|
# Check for incorrect fmt.Errorf error wrapping.
|
||||||
errorf: true
|
errorf: true
|
||||||
@@ -45,16 +57,11 @@ linters-settings:
|
|||||||
excludes:
|
excludes:
|
||||||
- G402 # Look for bad TLS connection settings.
|
- G402 # Look for bad TLS connection settings.
|
||||||
- G306 # Poor file permissions used when writing to a new file.
|
- G306 # Poor file permissions used when writing to a new file.
|
||||||
|
- G601 # Implicit memory aliasing in for loop.
|
||||||
|
|
||||||
staticcheck:
|
staticcheck:
|
||||||
checks: ["-SA1019"]
|
checks: ["-SA1019"]
|
||||||
|
|
||||||
lll:
|
|
||||||
# Max line length, lines longer will be reported.
|
|
||||||
line-length: 80
|
|
||||||
# Tab width in spaces.
|
|
||||||
tab-width: 8
|
|
||||||
|
|
||||||
funlen:
|
funlen:
|
||||||
# Checks the number of lines in a function.
|
# Checks the number of lines in a function.
|
||||||
# If lower than 0, disable the check.
|
# If lower than 0, disable the check.
|
||||||
@@ -105,6 +112,10 @@ linters-settings:
|
|||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
|
# We instead use our own custom line length linter called `ll` since
|
||||||
|
# then we can ignore log lines.
|
||||||
|
- lll
|
||||||
|
|
||||||
# Global variables are used in many places throughout the code base.
|
# Global variables are used in many places throughout the code base.
|
||||||
- gochecknoglobals
|
- gochecknoglobals
|
||||||
|
|
||||||
@@ -170,7 +181,7 @@ linters:
|
|||||||
- wrapcheck
|
- wrapcheck
|
||||||
|
|
||||||
# Allow dynamic errors.
|
# Allow dynamic errors.
|
||||||
- err113
|
- goerr113
|
||||||
|
|
||||||
# We use ErrXXX instead.
|
# We use ErrXXX instead.
|
||||||
- errname
|
- errname
|
||||||
@@ -186,7 +197,6 @@ linters:
|
|||||||
# The linter is too aggressive and doesn't add much value since reviewers
|
# The linter is too aggressive and doesn't add much value since reviewers
|
||||||
# will also catch magic numbers that make sense to extract.
|
# will also catch magic numbers that make sense to extract.
|
||||||
- gomnd
|
- gomnd
|
||||||
- mnd
|
|
||||||
|
|
||||||
# Some of the tests cannot be parallelized. On the other hand, we don't
|
# Some of the tests cannot be parallelized. On the other hand, we don't
|
||||||
# gain much performance with this check so we disable it for now until
|
# gain much performance with this check so we disable it for now until
|
||||||
@@ -204,6 +214,7 @@ linters:
|
|||||||
- depguard
|
- depguard
|
||||||
- gosmopolitan
|
- gosmopolitan
|
||||||
- intrange
|
- intrange
|
||||||
|
- goconst
|
||||||
|
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
|
Reference in New Issue
Block a user