-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.golangci.yml
132 lines (130 loc) · 3.63 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
linters:
enable:
- asasalint
- bodyclose
- containedctx
- contextcheck
- dogsled
- dupl
- durationcheck
- errchkjson
- errname
- errorlint
- exhaustive
- exhaustruct
- exportloopref # https://github.com/kyoh86/exportloopref#whats-this
- forcetypeassert # https://github.com/gostaticanalysis/forcetypeassert#forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- err113
- gofmt
- gofumpt
- goimports
- gomoddirectives
- goprintffuncname # https://github.com/jirfag/go-printf-func-name#go-printf-func-name
- grouper
- gosec
- importas
- interfacebloat
- ireturn
- lll
- makezero # https://github.com/ashanbrown/makezero#purpose
- misspell
- nakedret
- nestif
- nilerr # https://github.com/gostaticanalysis/nilerr#nilerr
- nilnil # https://github.com/Antonboom/nilnil#motivation
- nolintlint # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md#purpose
- paralleltest
- prealloc # https://github.com/alexkohler/prealloc#purpose
- revive
- rowserrcheck
- sqlclosecheck
- stylecheck
- tagliatelle
- tparallel # https://github.com/moricho/tparallel
- unconvert # https://github.com/mdempsky/unconvert#usage
- unparam
- usestdlibvars
- wastedassign
- whitespace
- wsl # https://github.com/bombsimon/wsl/blob/master/doc/rules.md
linters-settings:
wsl:
allow-assign-and-anything: true
issues:
exclude-dirs:
- trm/manager/mock
- sql/mock
exclude-use-default: false
exclude:
- ST1000 # ST1000: at least one file in a package should have a package comment
exclude-rules:
- linters:
- lll
source: "^//go:generate "
- linters:
- lll
source: "(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w\\.-]+)+[\\w\\-\\._~:/?#[\\]@!\\$&'\\(\\)\\*\\+,;=.]+"
- linters:
- lll
source: "// ?TODO "
- path: _test\.go
linters:
- wsl
text: "only cuddled expressions if assigning variable or using from line above"
- path: _test\.go
linters:
- wsl
text: "assignments should only be cuddled with other assignments"
- path: _test\.go
linters:
- revive
text: "seems to be unused, consider removing or renaming it as _"
- path: _test\.go
linters:
- revive
text: "context-keys-type: should not use basic type string as key in context.WithValue"
- path: _test\.go
linters:
- staticcheck
text: "SA1029: should not use built-in type string as key for value; define your own type to avoid collisions"
- path: (.+/)?context\.go
linters:
- ireturn
- path: (.+/)?transaction\.go
linters:
- ireturn
source: \) Begin\(ctx
- path: (.+/)?settings\.go
linters:
- ireturn
source: "(?:EnrichBy|SetPropagation|SetCtxKey|CtxKey|SetCancelable|SetTimeout)"
- linters:
- gochecknoglobals
source: "DefaultCtxGetter"
- &internal_text
path: (^trm/internal|^internal)
text: "var-naming: don't use an underscore in package name"
- <<: *internal_text
text: "package-comments: should have a package comment"
- <<: *internal_text
text: "ST1003: should not use underscores in package names"
- path: (_test\.go|^trm/internal|^internal)
linters:
- funlen
- gochecknoglobals
- goconst
- gomnd
- containedctx
- err113
- errcheck
- nolintlint
- forcetypeassert
- exhaustruct