forked from zulip/zulip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypy.ini
412 lines (309 loc) · 11.2 KB
/
mypy.ini
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
[mypy]
# Logistics of what code to check and how to handle the data.
scripts_are_modules = True
show_traceback = True
cache_dir = var/mypy-cache
# Options to make the checking stricter.
check_untyped_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
warn_no_return = True
no_implicit_optional = True
# The mypy daemon requires using local_partial_types.
local_partial_types = True
# It's useful to try this occasionally, and keep it clean; but when
# someone fixes a type error we don't want to add a burden for them.
#warn_unused_ignores = True
# Error on importing modules that are present but not part of the
# build. If the module can't reasonably be made to not error, errors
# can be suppressed with ignore_errors.
# (The mypy daemon only supports error and skip for follow_imports)
follow_imports = error
#
#
# IGNORE ERRORS
#
#
# We suppress all errors in a handful of files, all of them config files.
[mypy-conf] # For docs/conf.py.
ignore_errors = True
[mypy-zproject.settings]
ignore_errors = True
[mypy-zproject.test_settings]
ignore_errors = True
# zerver.tornado.autoreload is a slightly-patched piece of upstream Tornado.
[mypy-zerver.tornado.autoreload]
ignore_errors = True
#
#
# IGNORE MISSING IMPORTS
#
#
# Our code, imported relative to tools/ by scripts in that directory.
# Mypy doesn't know that these are scripts used as __main__, and
# doesn't find the imports.
[mypy-lib,lib.*]
ignore_missing_imports = True
[mypy-linter_lib.printer]
ignore_missing_imports = True
[mypy-lister,.lister]
ignore_missing_imports = True
# Our own libraries, maintained outside this repo and installed
# through pip. We need to tell mypy where to find them.
[mypy-zulip]
ignore_missing_imports = True
# This isn't the right solution (we should tell mypy where to find
# them), but it's necessary to avoid warnings like this:
# note: Import of 'zulip' ignored
# I'm not sure how to tell mypy where to find these without having it
# also process everything else in the Zulip virtualenv...
follow_imports = skip
[mypy-zulip_bots.lib]
ignore_missing_imports = True
[mypy-zulip_bots.custom_exceptions]
ignore_missing_imports = True
# Standard library (lex order)
[mypy-ConfigParser]
ignore_missing_imports = True
[mypy-multiprocessing.sharedctypes]
ignore_missing_imports = True
[mypy-typing.re]
ignore_missing_imports = True
[mypy-unittest.result]
ignore_missing_imports = True
# Third-party libraries (lex order)
[mypy-apiclient.sample_tools]
ignore_missing_imports = True
[mypy-apns2.*]
ignore_missing_imports = True
[mypy-bitfield,bitfield.*]
ignore_missing_imports = True
[mypy-bs4]
ignore_missing_imports = True
[mypy-coverage]
ignore_missing_imports = True
[mypy-cssutils,cssutils.*]
ignore_missing_imports = True
[mypy-defusedxml.*]
ignore_missing_imports = True
[mypy-digitalocean]
ignore_missing_imports = True
[mypy-disposable_email_domains]
ignore_missing_imports = True
[mypy-django,django.*]
ignore_missing_imports = True
[mypy-django_auth_ldap,django_auth_ldap.*]
ignore_missing_imports = True
[mypy-django_otp.*]
ignore_missing_imports = True
[mypy-django_statsd.*]
ignore_missing_imports = True
[mypy-DNS]
ignore_missing_imports = True
[mypy-gcm]
ignore_missing_imports = True
[mypy-gitlint,gitlint.*]
ignore_missing_imports = True
[mypy-httplib2]
ignore_missing_imports = True
[mypy-httpretty]
ignore_missing_imports = True
[mypy-hyper,hyper.*]
ignore_missing_imports = True
[mypy-ijson]
ignore_missing_imports = True
[mypy-ldap,fakeldap]
ignore_missing_imports = True
[mypy-lxml,lxml.*]
ignore_missing_imports = True
[mypy-markdown,markdown.*,markdown_include,markdown_include.*]
ignore_missing_imports = True
[mypy-mock]
ignore_missing_imports = True
[mypy-moto]
ignore_missing_imports = True
[mypy-netifaces]
ignore_missing_imports = True
[mypy-oauth2client.crypt]
ignore_missing_imports = True
[mypy-pika,pika.*]
ignore_missing_imports = True
[mypy-PIL]
ignore_missing_imports = True
[mypy-pipeline.storage]
ignore_missing_imports = True
[mypy-polib]
ignore_missing_imports = True
[mypy-premailer]
ignore_missing_imports = True
[mypy-psycopg2,psycopg2.*]
ignore_missing_imports = True
[mypy-pygments.*]
ignore_missing_imports = True
[mypy-pylibmc]
ignore_missing_imports = True
[mypy-pyoembed]
ignore_missing_imports = True
[mypy-redis]
ignore_missing_imports = True
[mypy-scrapy,scrapy.*]
ignore_missing_imports = True
[mypy-sendfile]
ignore_missing_imports = True
[mypy-six.moves.configparser]
ignore_missing_imports = True
[mypy-social_core.*]
ignore_missing_imports = True
[mypy-social_django,social_django.*]
ignore_missing_imports = True
[mypy-sockjs,sockjs.*]
ignore_missing_imports = True
[mypy-sourcemap]
ignore_missing_imports = True
[mypy-sqlalchemy,sqlalchemy.*]
ignore_missing_imports = True
[mypy-statsd]
ignore_missing_imports = True
[mypy-stripe,stripe.*]
ignore_missing_imports = True
[mypy-talon]
ignore_missing_imports = True
[mypy-tc_aws.loaders]
ignore_missing_imports = True
[mypy-thumbor.*]
ignore_missing_imports = True
[mypy-tornado,tornado.*]
ignore_missing_imports = True
[mypy-twitter]
ignore_missing_imports = True
[mypy-two_factor,two_factor.*]
ignore_missing_imports = True
[mypy-yamole]
ignore_missing_imports = True
#
#
# STRICT OPTIONAL
#
#
strict_optional = True
# REQ returning None issue
[mypy-zerver.decorator]
strict_optional = False
[mypy-zerver.views.zephyr]
strict_optional = False
[mypy-zerver.views.user_settings]
strict_optional = False
[mypy-zerver.views.streams]
strict_optional = False
[mypy-zerver.views.storage]
strict_optional = False
[mypy-zerver.views.report]
strict_optional = False
[mypy-zerver.views.integrations]
strict_optional = False
[mypy-zerver.tornado.views]
strict_optional = False
[mypy-zerver.views.events_register]
strict_optional = False
[mypy-zerver.lib.webhooks.common]
strict_optional = False
[mypy-zerver.webhooks.yo.view]
strict_optional = False
[mypy-zerver.webhooks.transifex.view]
strict_optional = False
[mypy-zerver.webhooks.newrelic.view]
strict_optional = False
[mypy-zerver.webhooks.gogs.view]
strict_optional = False
[mypy-zerver.webhooks.gitlab.view]
strict_optional = False
[mypy-zerver.webhooks.github.view]
strict_optional = False
[mypy-zerver.webhooks.bitbucket.view]
strict_optional = False
[mypy-zerver.webhooks.bitbucket2.view]
strict_optional = False
[mypy-zerver.webhooks.beanstalk.view]
strict_optional = False
[mypy-zerver.views.auth] # Other issues in this file too
strict_optional = False
[mypy-zerver.views.realm] # Other issues in this file too
strict_optional = False
[mypy-zerver.views.messages] # Other issues in this file too
strict_optional = False
# One change required?
[mypy-zerver.migrations.0077_add_file_name_field_to_realm_emoji] #73: error: Argument 2 to "upload_files" of "Uploader" has incompatible type "Optional[bytes]"; expected "bytes"
strict_optional = False
[mypy-zilencer.management.commands.calculate_first_visible_message_id] #33: error: Argument 1 to "maybe_update_first_visible_message_id" has incompatible type "Optional[Realm]"; expected "Realm"
strict_optional = False
[mypy-zilencer.management.commands.add_new_realm] #22: error: List item 0 has incompatible type "Optional[Stream]"; expected "Stream"
strict_optional = False
# Re-architecting required?
[mypy-zerver.lib.queue] # Delayed setup of SimpleQueueClient.channel (Optional)
strict_optional = False
[mypy-zerver/management/commands/purge_queue] #24: error: Item "None" of "Optional[Any]" has no attribute "queue_purge"
strict_optional = False
[mypy-zerver.tornado.handlers] # Delayed setup of ASyncDjangoHandler._request_middleware (Optional), line 200 error
strict_optional = False
[mypy-zerver.tornado.descriptors] # line 10: 'get' can return None; only used in zerver/tornado/handlers?
strict_optional = False
# Tests (may be many issues in file; comment is just one error noted)
[mypy-zerver/tests/test_tornado] #202: error: Item "None" of "Optional[Morsel[Any]]" has no attribute "coded_value"
strict_optional = False
[mypy-zerver/tests/test_slack_importer] #70: error: Argument 1 to "MockResponse" has incompatible type "None"; expected "Dict[str, Any]"
strict_optional = False
[mypy-zerver/tests/test_service_bot_system] #312: error: Argument 1 to "set_bot_config" has incompatible type "Optional[UserProfile]"; expected "UserProfile"
strict_optional = False
[mypy-zerver/tests/test_outgoing_webhook_system] #33: error: Argument 1 to "MockServiceHandler" has incompatible type "None"; expected "str"
strict_optional = False
[mypy-zerver/tests/test_outgoing_webhook_interfaces] #22: error: Argument "user_profile" to "GenericOutgoingWebhookService" has incompatible type "None"; expected "UserProfile"
strict_optional = False
[mypy-zerver/tests/test_narrow] #515: error: Incompatible types in assignment (expression has type "None", variable has type "int")
strict_optional = False
[mypy-zerver/tests/test_logging_handlers] #73: error: Argument 7 to "makeRecord" of "Logger" has incompatible type "Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]"; expected "Union[Tuple[type, BaseException, TracebackType], Tuple[None, None, None], None]"
strict_optional = False
[mypy-zerver/tests/test_link_embed] #53: error: Value of type "Optional[Dict[Any, Any]]" is not indexable
strict_optional = False
[mypy-zerver/tests/test_embedded_bot_system] #26: error: Item "None" of "Optional[UserProfile]" has no attribute "email"
strict_optional = False
[mypy-zerver/tests/test_decorators] #1322: error: Item "None" of "Optional[Match[str]]" has no attribute "groupdict"
strict_optional = False
[mypy-zerver/tests/test_auth_backends] #2079: error: Incompatible types in assignment (expression has type "Optional[UserProfile]", variable has type "UserProfile")
strict_optional = False
[mypy-zerver/tests/test_signup] #1954: error: Item "None" of "Optional[Match[Any]]" has no attribute "groups"
strict_optional = False
[mypy-zerver/tests/test_realm] #191: error: Item "None" of "Optional[Stream]" has no attribute "id"
strict_optional = False
[mypy-zerver/tests/test_messages] #3070: error: Incompatible types in assignment (expression has type "None", variable has type "int")
strict_optional = False
[mypy-zerver/tests/test_events] #1365: error: Argument 2 to "do_set_realm_notifications_stream" has incompatible type "Optional[Stream]"; expected "Stream"
strict_optional = False
[mypy-zerver/tests/test_docs] #131: error: Argument 1 to "isfile" has incompatible type "Optional[str]"; expected "Union[bytes, str]"
strict_optional = False
# General exclusions to work on
[mypy-zerver.lib.test_helpers]
strict_optional = False
[mypy-zerver.lib.test_classes]
strict_optional = False
[mypy-zerver.tornado.event_queue]
strict_optional = False
[mypy-zerver.lib.outgoing_webhook]
strict_optional = False
[mypy-zerver.lib.bugdown] # for __init__.py
strict_optional = False
[mypy-zerver.lib.push_notifications]
strict_optional = False
[mypy-zerver.lib.actions]
strict_optional = False
[mypy-zproject.backends]
strict_optional = False
[mypy-zerver.worker.queue_processors]
strict_optional = False
[mypy-zerver.tornado.websocket_client]
strict_optional = False
[mypy-zerver.lib.slack_message_conversion]
strict_optional = False
[mypy-zerver.views.registration]
strict_optional = False
[mypy-tools.lib.html_branches]
strict_optional = False