forked from lightninglabs/lightning-node-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
120 lines (100 loc) · 2.75 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
run:
# timeout for analysis
deadline: 4m
build-tags:
- autopilotrpc
- chainrpc
- invoicesrpc
- neutrinorpc
- peersrpc
- 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
funlen:
# Checks the number of lines in a function.
# If lower than 0, disable the check.
lines: 200
# Checks the number of statements in a function.
statements: 80
gosec:
excludes:
- G402 # Look for bad TLS connection settings.
- G306 # Poor file permissions used when writing to a new file.
whitespace:
multi-func: true
multi-if: true
linters:
enable-all: true
disable:
# Allow dynamic errors.
- goerr113
# We want to allow short variable names.
- varnamelen
# Allow tests to be put in the same package.
- testpackage
# We want to allow TODOs.
- godox
# Init functions are used by loggers throughout the codebase.
- gochecknoinits
# Global variables are used by loggers.
- 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 require that all structs have all fields initialized when new
# instances are created.
- exhaustruct
# Disable gofumpt as it has weird behavior regarding formatting multiple
# lines for a function which is in conflict with our contribution
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
- gofumpt
# Disable whitespace linter as it has conflict rules against our
# contribution guidelines. See https://github.com/bombsimon/wsl/issues/109.
#
# TODO: bring it back when the above issue is fixed.
- wsl
# Deprecated linters. See https://golangci-lint.run/usage/linters/.
- interfacer
- golint
- maligned
- scopelint
- exhaustivestruct
- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- structcheck
- tparallel
- unparam
- wastedassign
- ifshort
- varcheck
- deadcode
- nosnakecase
issues:
# Only show newly introduced problems.
new-from-rev: 4008b92d81d4d62e663025c5f79ebe44b53f283c
exclude-rules:
# Exclude gosec from running for tests so that tests with weak randomness
# (math/rand) will pass the linter. We also exclude funlen from tests as
# have test functions that are intentionally long.
- path: _test\.go
linters:
- gosec
- funlen
- path: test*
linters:
- gosec
- funlen
- path: itest/.*
linters:
- paralleltest