-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
167 lines (167 loc) · 4.22 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
run:
timeout: "10m"
output:
uniq-by-line: false
sort-results: true
linters:
disable-all: true
enable:
- "asasalint"
- "asciicheck"
- "bidichk"
- "bodyclose"
- "containedctx"
- "contextcheck"
- "copyloopvar"
# - "cyclop" # Redundant with gocyclo.
# - "deadcode" # Replaced by unused.
# - "decorder" # Maybe overkill.
- "depguard"
- "dogsled"
- "dupl"
- "dupword"
- "durationcheck"
- "errcheck"
- "errchkjson"
- "errname"
- "errorlint"
- "exhaustive"
# - "exhaustivestruct " # Replaced by exhaustruct.
# - "exhaustruct" # Too many false positive, and not always relevant.
# - "exportloopref" # Deprecated and replaced by copyloopvar.
- "forbidigo"
- "forcetypeassert"
# - "funlen" # It causes issues in table driven tests, and cyclomatic complexity is more relevant.
# - "gci" # Redundant with goimports and grouper.
# - "ginkgolinter" # Not used.
- "gocheckcompilerdirectives"
# - "gochecknoglobals" # It's OK.
# - "gochecknoinits" # It's OK.
- "gochecksumtype"
# - "gocognit" # Redundant with gocyclo.
# - "goconst" # Too many false positive.
- "gocritic"
- "gocyclo"
- "godot"
# - "godox" # Should not be reported as error.
# - "goerr113" # Not useful.
- "gofmt"
- "gofumpt"
# - "goheader" # Not useful.
- "goimports"
# - "golint" # Replaced by revive.
# - "gomnd" # Too many false positive.
# - "gomoddirectives" # Not useful.
# - "gomodguard" # Redundant with depguard.
- "goprintffuncname"
- "gosec"
- "gosimple"
# - "gosmopolitan" # Not useful.
- "govet"
- "grouper"
# - "ifshort" # Deprecated.
- "importas"
- "inamedparam"
- "ineffassign"
- "interfacebloat"
# - "interfacer" # Archived.
- intrange
# - "ireturn" # Too many false positive.
# - "lll" # We don't use punch cards anymore.
- "loggercheck"
# - "maintidx" # Redundant with gocyclo.
- "makezero"
# - "maligned" # Replaced by govet 'fieldalignment'.
- "mirror"
- "misspell"
- "nakedret"
- "nestif"
- "nilerr"
- "nilnil"
# - "nlreturn" # Is that a good practice ?
- "noctx"
- "nolintlint"
# - "nonamedreturns" # Named returns are OK.
# - "nosnakecase" # Deprecated.
- "nosprintfhostport"
# - "paralleltest" # Not useful.
- "perfsprint"
- "prealloc"
- "predeclared"
- "promlinter"
# - "protogetter" # Not useful.
- "reassign"
- "revive"
- "rowserrcheck"
# - "scopelint" # Replaced by exportloopref.
- "sloglint"
- "sqlclosecheck"
- "staticcheck"
# - "structcheck" # Replaced by unused.
- "stylecheck"
# - "tagalign" # Not useful.
# - "tagliatelle" # Not useful.
- "tenv"
- "testableexamples"
# - "testifylint" # Not useful.
# - "testpackage" # Not useful.
- "thelper"
# - "tparallel" # Not useful.
# - "typecheck" # Removed
- "unconvert"
- "unparam"
- "unused"
- "usestdlibvars"
# - "varcheck" # Replaced by unused.
# - "varnamelen" # Maybe overkill.
- "wastedassign"
- "whitespace"
- "wrapcheck"
# - "wsl" # Not useful.
# - "zerologlint" # Not useful.
linters-settings:
depguard:
rules:
main:
files:
- "$all"
deny:
- pkg: "unsafe"
desc: "it's not safe"
gocritic:
enabled-tags:
- "experimental"
- "diagnostic"
- "opinionated"
- "performance"
- "style"
disabled-checks:
- "paramTypeCombine" # Some false positive.
- "whyNoLint" # We already have the nolintlint linter.
gocyclo:
min-complexity: 10
govet:
enable-all: true
disable:
- "fieldalignment" # Too many false positive.
grouper:
import-require-single-import: true
import-require-grouping: true
nolintlint:
allow-unused: false
allow-no-explanation:
- "errcheck"
- "misspell"
require-explanation: true
require-specific: true
revive:
rules:
- name: "exported"
disabled: false
arguments:
- "disableStutteringCheck"
- name: "unused-parameter" # It's OK.
disabled: true
issues:
max-issues-per-linter: 0
max-same-issues: 1