-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
115 lines (112 loc) · 3.51 KB
/
.golangci.yaml
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
linters-settings:
dogsled:
# Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()).
max-blank-identifiers: 2
gocognit:
# Minimal cognitive complexity to report.
min-complexity: 20
gocyclo:
# Minimal cyclomatic complexity to report.
min-complexity: 10
gofumpt:
# Whether or not to use the extra rules extending gofmt.
extra-rules: true
lll:
# Minimal line length to report.
line-length: 150
# Tab 'length' when counting length of the line.
tab-width: 1
misspell:
# Locale to use when checking for misspellings.
locale: "US"
nestif:
# Minimal complexity of if statements to report.
min-complexity: 4
prealloc:
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them
simple: false
# Report preallocation suggestions on range loops.
range-loops: true
# Report preallocation suggestions on for loops.
for-loops: true
testpackage:
# Regexp pattern to skip files.
skip-regexp: "(whitebox)_test\\.go"
wsl:
# If true append is only allowed to be cuddled if appending value is matching variables, fields or types on line above
strict-append: true
# Allow calls and assignments to be cuddled as long as the lines have any matching variables, fields or types.
allow-assign-and-call: false
# Allow multiline assignments to be cuddled.
allow-multiline-assign: false
# Allow declarations (var) to be cuddled.
allow-cuddle-declarations: false
# Allow trailing comments in ending of blocks.
allow-trailing-comment: false
# Force newlines in end of case at this limit (0 = never).
force-case-trailing-whitespace: 0
# Force cuddling of err checks with err var assignment.
force-err-cuddling: true
# Allow leading comments to be separated with empty lines.
allow-separated-leading-comment: false
staticcheck:
go: "1.17"
checks: ["all"]
govet:
# report about shadowed variables
check-shadowing: true
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- dogsled
- gocognit
- gocyclo
- gocritic
- godot
- gofumpt
- revive
- ifshort
- lll
- misspell
- nestif
- noctx # Doesn't have any config for linters-settings section.
- prealloc
- staticcheck
- testpackage
- wsl
- ineffassign
- govet
issues:
include:
# Disable excluding of issues about comments from revive.
- EXC0012
# ineffective break statement. Did you mean to break out of the outer loop? (staticcheck)
- EXC0005
exclude-rules:
- path: transaction/query.go
text: "variable 'zero' is only used in the if-statement"
# Disable some linters for tests.
- path: _test\.go
linters:
- revive
- wsl
- ifshort
# Disable reporting some particular issues.
- linters:
- wsl
text: "if statements should only be cuddled with assignments"
- linters:
- wsl
text: "return statements should not be cuddled if block has more than two lines"
- linters:
- revive
text: "unless it's in another file for this package"
# Exclude issues for long lines with go:generate
- linters:
- lll
source: "^//go:generate "
- linters:
- govet
text: 'declaration of "(err|ctx)" shadows declaration at'