mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
c8df606427
To reduce the likelyhood of the linter OOMing on the GitHub runner, we exclude any generated code from being inspected and also tune the golang garbage collector to be a bit more agressive.
79 lines
2.0 KiB
YAML
79 lines
2.0 KiB
YAML
run:
|
|
# timeout for analysis
|
|
deadline: 10m
|
|
|
|
# Skip autogenerated files for mobile and gRPC.
|
|
skip-files:
|
|
- "mobile\\/.*generated\\.go"
|
|
- "\\.pb\\.go$"
|
|
- "\\.pb\\.gw\\.go$"
|
|
|
|
skip-dirs:
|
|
- channeldb/migration_01_to_11
|
|
- channeldb/migration/lnwire21
|
|
|
|
build-tags:
|
|
- autopilotrpc
|
|
- chainrpc
|
|
- invoicesrpc
|
|
- signrpc
|
|
- walletrpc
|
|
- watchtowerrpc
|
|
|
|
linters-settings:
|
|
govet:
|
|
# Don't report about shadowed variables
|
|
check-shadowing: false
|
|
gofmt:
|
|
# simplify code: gofmt with `-s` option, true by default
|
|
simplify: true
|
|
|
|
linters:
|
|
enable-all: true
|
|
disable:
|
|
# Global variables are used in many places throughout the code base.
|
|
- 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
|
|
|
|
# We don't care (enough) about misaligned structs to lint that.
|
|
- maligned
|
|
|
|
# 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
|
|
# potentially extensively refactor code, when they want to smaller change to
|
|
# land.
|
|
- gocyclo
|
|
|
|
# Instances of table driven tests that don't pre-allocate shouldn't trigger
|
|
# the linter.
|
|
- prealloc
|
|
|
|
# Init functions are used by loggers throughout the codebase.
|
|
- gochecknoinits
|
|
|
|
issues:
|
|
# Only show newly introduced problems.
|
|
new-from-rev: 01f696afce2f9c0d4ed854edefa3846891d01d8a
|
|
|
|
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
|
|
|
|
# Fix false positives because of build flags in itest directory.
|
|
- path: lntest/itest/.*
|
|
linters:
|
|
- unused
|
|
- deadcode
|
|
- unparam
|
|
- govet
|