-
Notifications
You must be signed in to change notification settings - Fork 49
/
.golangci.yml
107 lines (100 loc) · 2.03 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
run:
timeout: 3m
linters-settings:
funlen:
lines: 100
statements: 80
govet:
check-shadowing: false #too many false positives on shadowed err
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
golint:
min-confidence: 0
gofmt:
simplify: true
gocyclo:
min-complexity: 20
gocognit:
min-complexity: 10
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
lll:
line-length: 120
tab-width: 1
nakedret:
max-func-lines: 0
dogsled:
max-blank-identifiers: 2
linters:
disable-all: true
enable:
- megacheck
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- funlen
- gochecknoinits
- goconst
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- misspell
- nakedret
- scopelint
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- maligned
#best practice: add --enable=golint,gocritic to your editor configuration when using golangci-lint
# don't enable:
# - gochecknoglobals
# - gocognit # akin to gocyclo
# - godox # checks for TODO/BUG/FIXME
# - prealloc
# - wsl
# - stylecheck
# - lll # checks line length
# - golint
# - gocritic
presets:
- bugs
- unused
fast: false
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
exclude-use-default: true
max-issues-per-linter: 0
max-same-issues: 0