lightning-terminal/.golangci.yml
ffranr e96424cc4a
makefile+tools: add custom 'll' linter for extended line length checks
- Replace the default `lll` with a custom `ll` linter, enabling
  configurable exclusions for specific `S` log lines.
- Integrate custom `ll` linter into the build system and `Makefile`.
- Include relevant test cases and configuration for `golangci-lint`.
2025-12-09 16:12:03 +00:00

74 lines
1.7 KiB
YAML

run:
# timeout for analysis
timeout: 10m
build-tags:
- autopilotrpc
- signrpc
- walletrpc
- chainrpc
- invoicesrpc
- watchtowerrpc
- neutrinorpc
- peersrpc
- dev
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\\("
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.
- G601 # Implicit memory aliasing in for loop.
- G115 # Integer overflow in conversion.
staticcheck:
checks: ["-SA1019"]
linters:
enable:
- ll
- gofmt
- tagliatelle
- whitespace
- gosec
issues:
exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
# (math/rand) will pass the linter.
- path: _test\.go
linters:
- gosec
- path: internal/test/.*
linters:
- gosec
# Fix false positives because of build flags in itest directory.
- path: itest/.*
linters:
- unused
- deadcode
- varcheck