-
-
Notifications
You must be signed in to change notification settings - Fork 551
Expand file tree
/
Copy path.golangci.yml
More file actions
202 lines (202 loc) · 5.46 KB
/
Copy path.golangci.yml
File metadata and controls
202 lines (202 loc) · 5.46 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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: "2"
run:
tests: true
build-tags:
- mage
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- contextcheck
- err113
- errchkjson
- errorlint
- exhaustive
- gocheckcompilerdirectives
- gochecksumtype
- gocritic
- gocyclo
- goheader
- gosec
- gosmopolitan
- loggercheck
- makezero
- misspell
- nilerr
- nilnesserr
- noctx
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- spancheck
- sqlclosecheck
- testifylint
- unparam
- zerologlint
disable:
- durationcheck
- goconst
- musttag
settings:
goheader:
template-path: code-header-template.txt
nestif:
min-complexity: 6
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- deadcode
- errorlint
- gocyclo
path: _test\.go
- linters:
- bodyclose
- deadcode
- gocyclo
- unparam
- varcheck
path: pkg/webtests/*
- linters:
- gocritic
path: pkg/webtests/*
text: unlambda
- linters:
- bodyclose
path: pkg/modules/background/unsplash/unsplash\.go
- linters:
- err113
- exhaustive
path: pkg/migration/*
- linters:
- exhaustive
path: pkg/models/task_collection_filter\.go
- linters:
- gosec
path: pkg/utils/random_string\.go
text: 'G404:' # We don't care about cryptographically secure randomness when we're using that utility function.
- linters:
- err113
path: pkg/modules/dump/*
- linters:
- err113
path: pkg/
text: 'do not define dynamic errors, use wrapped static errors instead:'
- linters:
- gocritic
text: 'commentFormatting: put a space between `//` and comment text'
- linters:
- gocyclo
path: pkg/modules/migration
- linters:
- goheader
- gosmopolitan
- misspell
path: pkg/routes/api/v1/docs.go
- linters:
- goheader
text: Missed string
- linters:
- errorlint
path: pkg/.*/error.go
- linters:
- nilerr
path: pkg/models/favorites\.go
- path: pkg/models/project\.go
text: string `parent_project_id` has 3 occurrences, make it a constant
- linters:
- musttag
path: pkg/models/events\.go
- path: pkg/models/task_collection.go
text: append result not assigned to the same slice
- linters:
- testifylint
path: pkg/modules/migration/ticktick/ticktick_test.go
- linters:
- revive
path: pkg/migration/*
text: parameter 'tx' seems to be unused, consider removing or renaming it as
- linters:
- gosec
path: pkg/cmd/user.go
text: 'G115: integer overflow conversion uintptr -> int'
- linters:
- gosec
text: 'G115: integer overflow conversion int64 -> uint64'
- linters:
- gosec
text: 'G115: integer overflow conversion int -> uint64'
- linters:
- recvcheck
text: the methods of "Permission" use pointer receiver and non-pointer receiver.
- linters:
- recvcheck
text: the methods of "SubscriptionEntityType" use pointer receiver and non-pointer receiver.
- linters:
- revive
path: pkg/utils/*
text: 'var-naming: avoid meaningless package names'
- linters:
- revive
path: pkg/routes/api/shared/*
text: 'var-naming: avoid meaningless package names'
- linters:
- contextcheck
path: pkg/routes/api/v2/backgrounds.go # the unsplash provider intentionally uses context.Background(); its interface is shared with v1 and can't take a context
- linters:
- revive
text: 'var-naming: avoid package names that conflict with Go standard library package names'
- linters:
- err113
path: magefile.go
text: 'do not define dynamic errors, use wrapped static errors instead:'
- linters:
- gosec
text: 'G117:' # Struct fields named Password/Secret/AccessToken are intentional data model fields
- linters:
- gosec
text: 'G101:'
path: (pkg/webtests/|pkg/e2etests/|_test\.go) # Test fixtures with bcrypt hashes, not real credentials
- linters:
- gosec
text: 'G70[234]:'
path: magefile.go # Build tooling, not user-facing code
- linters:
- goheader
path: plugins/
# gosec G124 flags synthetic request cookies in tests; they carry no security relevance.
- linters:
- gosec
text: 'G124:'
path: _test\.go
# noctx flags httptest.NewRequest, which builds inbound requests for handler tests where a cancellation context adds nothing.
- linters:
- noctx
text: 'httptest.NewRequest must not be called'
paths:
- third_party$
- builtin$
- examples$
- pkg/routes/api/v1/docs.go
- pkg/yaegi_symbols/..*
- plugins-dev/..*
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- pkg/yaegi_symbols/..*