-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy path.golangci.yml
More file actions
105 lines (100 loc) · 1.94 KB
/
.golangci.yml
File metadata and controls
105 lines (100 loc) · 1.94 KB
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
version: "2"
run:
concurrency: 4
# also lint _test.go files
tests: true
timeout: 5m
linters:
enable:
- govet
- staticcheck
- unused
- errcheck
- gocritic
- gocyclo
- revive
- ineffassign
- unconvert
- goconst
# - depguard
- prealloc
# - dupl
- misspell
- bodyclose
- sqlclosecheck
- nilerr
- nestif
- forcetypeassert
- exhaustive
- funlen
# - wsl_v5
- testifylint
- whitespace
- perfsprint
- nolintlint
- godot
- thelper
- tparallel
- paralleltest
- predeclared
- modernize
# disable noisy/controversial ones which you might enable later
disable:
- lll # line length — handled by gfmt/gofumpt
settings:
dupl:
threshold: 20 # lower => stricter (tokens)
errcheck:
check-type-assertions: true
funlen:
lines: 120
statements: 80
goconst:
min-len: 2
min-occurrences: 3
gocyclo:
min-complexity: 15 # strict; lower => stricter
wsl_v5:
allow-first-in-block: true
allow-whole-block: false
branch-max-lines: 2
testifylint:
disable:
- require-error
- float-compare
exclusions:
generated: lax
paths:
- examples$
rules:
- linters:
- revive
text: "^unused-parameter:"
- linters:
- revive
text: "^package-comments:"
- linters:
- errcheck
text: "Error return value of `.*\\.Body\\.Close` is not checked"
# linters disabled in tests
- linters:
- dupl
- goconst
- funlen
path: "_test\\.go$"
issues:
max-issues-per-linter: 0 # 0 = unlimited (we want ALL issues)
max-same-issues: 100
formatters:
enable:
- gofmt
- gofumpt
settings:
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$