-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
129 lines (121 loc) · 3.54 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
run:
build-tags:
- citest
issues:
exclude-use-default: false
exclude-rules:
- path: _test\.go
linters:
- const
- dupl
- gochecknoglobals
- goconst
- golint
- unparam
linters-settings:
gocyclo:
min-complexity: 35
gocognit:
# 10-30 is recommended
min-complexity: 10
lll:
line-length: 140
tab-width: 2
godot:
scope: toplevel
period: true
capital: true
reassign:
# never allow reassign of any package variable in another package
pattern: '.*'
linters:
disable-all: true
enable:
- bidichk
- bodyclose
- containedctx
- contextcheck
- decorder
- depguard # needs separate config to actually guard use of packages
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exportloopref
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- revive
- gosimple
- govet
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nilnil
- nolintlint
- prealloc
- predeclared
- reassign
- staticcheck
- tenv
- testableexamples
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused # was disabled due to out-of-memory issues
- wastedassign
- whitespace
- unparam
- stylecheck
- godot
# don't enable:
# - cyclop # similar to gocyclop, but also for packages
# - decorder # irritating
# - execinquery # SQL checker (not needed)
# - exhaustive # good, but does not seem to be configurable with ignore comment
# - exhaustruct # many libraries not marked up for this linter thus causing false positives for optional fields
# - forbidgod # can be turned on if we want to flag certain types of debug and experiment code, requires config1
# - funlen
# - gochecknoglobals
# - gochecknoinits
# - godox
# - goerr113 # seems to be covered by errorlint
# - gofumpt # did not like some of the formatting ideas
# - goheader # checks for license in comments (for example)
# - gomnd # magic numbers, requires configuration to not be irritating
# - goprintffuncname
# - grouper # covered by other linters
# - importas # turn on if using Kubernetes to make import lint to sanity
# - interfacebloat
# - ireturn # could be turned on if this becomes a problem
# - loggercheck # for loggers we don't use
# - maintidx # maintenance index limit (sorry, but docs are in japanese)
# - nlreturn # unwanted lint
# - noctx
# - nonamedreturns # unwanted lint
# - nosprintfhostport # too naive and for a special case
# - paralleltest # lots of false positives from normal non parallell tests, using tparallell instead
# - promlinter # Prometheus specific (turn if using Prometheus)
# - revive # coverd by others, turn on and use if there is a specific revive lint to use
# - rowserrcheck # specific for SQL, turn on if SQL is used
# - sqlclosecheck # specific to DQL, turn on if SQL is used
# - stylecheck # similar to revive (also a replacement of golint)
# - tagliatelle # turn on if runnng into issues with style consistency in struct serialization tags
# - usestdlibvars # not general purpose
# - varnamelen # problem is more if names are bad than if they are too short
# - whitespace # covered by others, have autofix though which can be used if wanted
# - wrapcheck # well, it isn't enough to do this, so should not be encouraged
# - wsl # important formatting already checked by others