mypy.ini 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. [mypy]
  2. namespace_packages = True
  3. plugins = mypy_zope:plugin, scripts-dev/mypy_synapse_plugin.py
  4. follow_imports = normal
  5. check_untyped_defs = True
  6. show_error_codes = True
  7. show_traceback = True
  8. mypy_path = stubs
  9. warn_unreachable = True
  10. local_partial_types = True
  11. no_implicit_optional = True
  12. files =
  13. scripts-dev/sign_json,
  14. setup.py,
  15. synapse/,
  16. tests/
  17. # Note: Better exclusion syntax coming in mypy > 0.910
  18. # https://github.com/python/mypy/pull/11329
  19. #
  20. # For now, set the (?x) flag enable "verbose" regexes
  21. # https://docs.python.org/3/library/re.html#re.X
  22. exclude = (?x)
  23. ^(
  24. |synapse/storage/databases/__init__.py
  25. |synapse/storage/databases/main/__init__.py
  26. |synapse/storage/databases/main/account_data.py
  27. |synapse/storage/databases/main/cache.py
  28. |synapse/storage/databases/main/devices.py
  29. |synapse/storage/databases/main/e2e_room_keys.py
  30. |synapse/storage/databases/main/end_to_end_keys.py
  31. |synapse/storage/databases/main/event_federation.py
  32. |synapse/storage/databases/main/event_push_actions.py
  33. |synapse/storage/databases/main/events_bg_updates.py
  34. |synapse/storage/databases/main/events_worker.py
  35. |synapse/storage/databases/main/group_server.py
  36. |synapse/storage/databases/main/metrics.py
  37. |synapse/storage/databases/main/monthly_active_users.py
  38. |synapse/storage/databases/main/presence.py
  39. |synapse/storage/databases/main/purge_events.py
  40. |synapse/storage/databases/main/push_rule.py
  41. |synapse/storage/databases/main/receipts.py
  42. |synapse/storage/databases/main/room.py
  43. |synapse/storage/databases/main/roommember.py
  44. |synapse/storage/databases/main/search.py
  45. |synapse/storage/databases/main/state.py
  46. |synapse/storage/databases/main/stats.py
  47. |synapse/storage/databases/main/transactions.py
  48. |synapse/storage/databases/main/user_directory.py
  49. |synapse/storage/schema/
  50. |tests/api/test_auth.py
  51. |tests/api/test_ratelimiting.py
  52. |tests/app/test_openid_listener.py
  53. |tests/appservice/test_scheduler.py
  54. |tests/config/test_cache.py
  55. |tests/config/test_tls.py
  56. |tests/crypto/test_keyring.py
  57. |tests/events/test_presence_router.py
  58. |tests/events/test_utils.py
  59. |tests/federation/test_federation_catch_up.py
  60. |tests/federation/test_federation_sender.py
  61. |tests/federation/test_federation_server.py
  62. |tests/federation/transport/test_knocking.py
  63. |tests/federation/transport/test_server.py
  64. |tests/handlers/test_cas.py
  65. |tests/handlers/test_directory.py
  66. |tests/handlers/test_e2e_keys.py
  67. |tests/handlers/test_federation.py
  68. |tests/handlers/test_oidc.py
  69. |tests/handlers/test_presence.py
  70. |tests/handlers/test_profile.py
  71. |tests/handlers/test_saml.py
  72. |tests/handlers/test_typing.py
  73. |tests/http/federation/test_matrix_federation_agent.py
  74. |tests/http/federation/test_srv_resolver.py
  75. |tests/http/test_fedclient.py
  76. |tests/http/test_proxyagent.py
  77. |tests/http/test_servlet.py
  78. |tests/http/test_site.py
  79. |tests/logging/__init__.py
  80. |tests/logging/test_terse_json.py
  81. |tests/module_api/test_api.py
  82. |tests/push/test_email.py
  83. |tests/push/test_http.py
  84. |tests/push/test_presentable_names.py
  85. |tests/push/test_push_rule_evaluator.py
  86. |tests/rest/admin/test_admin.py
  87. |tests/rest/admin/test_device.py
  88. |tests/rest/admin/test_media.py
  89. |tests/rest/admin/test_server_notice.py
  90. |tests/rest/admin/test_user.py
  91. |tests/rest/admin/test_username_available.py
  92. |tests/rest/client/test_account.py
  93. |tests/rest/client/test_events.py
  94. |tests/rest/client/test_filter.py
  95. |tests/rest/client/test_groups.py
  96. |tests/rest/client/test_register.py
  97. |tests/rest/client/test_report_event.py
  98. |tests/rest/client/test_rooms.py
  99. |tests/rest/client/test_third_party_rules.py
  100. |tests/rest/client/test_transactions.py
  101. |tests/rest/client/test_typing.py
  102. |tests/rest/client/utils.py
  103. |tests/rest/key/v2/test_remote_key_resource.py
  104. |tests/rest/media/v1/test_base.py
  105. |tests/rest/media/v1/test_media_storage.py
  106. |tests/rest/media/v1/test_url_preview.py
  107. |tests/scripts/test_new_matrix_user.py
  108. |tests/server.py
  109. |tests/server_notices/test_resource_limits_server_notices.py
  110. |tests/state/test_v2.py
  111. |tests/storage/test_account_data.py
  112. |tests/storage/test_appservice.py
  113. |tests/storage/test_background_update.py
  114. |tests/storage/test_base.py
  115. |tests/storage/test_client_ips.py
  116. |tests/storage/test_database.py
  117. |tests/storage/test_event_federation.py
  118. |tests/storage/test_id_generators.py
  119. |tests/storage/test_roommember.py
  120. |tests/test_metrics.py
  121. |tests/test_phone_home.py
  122. |tests/test_server.py
  123. |tests/test_state.py
  124. |tests/test_terms_auth.py
  125. |tests/test_visibility.py
  126. |tests/unittest.py
  127. |tests/util/caches/test_cached_call.py
  128. |tests/util/caches/test_deferred_cache.py
  129. |tests/util/caches/test_descriptors.py
  130. |tests/util/caches/test_response_cache.py
  131. |tests/util/caches/test_ttlcache.py
  132. |tests/util/test_async_helpers.py
  133. |tests/util/test_batching_queue.py
  134. |tests/util/test_dict_cache.py
  135. |tests/util/test_expiring_cache.py
  136. |tests/util/test_file_consumer.py
  137. |tests/util/test_linearizer.py
  138. |tests/util/test_logcontext.py
  139. |tests/util/test_lrucache.py
  140. |tests/util/test_rwlock.py
  141. |tests/util/test_wheel_timer.py
  142. |tests/utils.py
  143. )$
  144. [mypy-synapse.api.*]
  145. disallow_untyped_defs = True
  146. [mypy-synapse.app.*]
  147. disallow_untyped_defs = True
  148. [mypy-synapse.crypto.*]
  149. disallow_untyped_defs = True
  150. [mypy-synapse.events.*]
  151. disallow_untyped_defs = True
  152. [mypy-synapse.handlers.*]
  153. disallow_untyped_defs = True
  154. [mypy-synapse.push.*]
  155. disallow_untyped_defs = True
  156. [mypy-synapse.rest.*]
  157. disallow_untyped_defs = True
  158. [mypy-synapse.server_notices.*]
  159. disallow_untyped_defs = True
  160. [mypy-synapse.state.*]
  161. disallow_untyped_defs = True
  162. [mypy-synapse.storage.databases.main.client_ips]
  163. disallow_untyped_defs = True
  164. [mypy-synapse.storage.databases.main.directory]
  165. disallow_untyped_defs = True
  166. [mypy-synapse.storage.databases.main.room_batch]
  167. disallow_untyped_defs = True
  168. [mypy-synapse.storage.databases.main.profile]
  169. disallow_untyped_defs = True
  170. [mypy-synapse.storage.databases.main.state_deltas]
  171. disallow_untyped_defs = True
  172. [mypy-synapse.storage.databases.main.user_erasure_store]
  173. disallow_untyped_defs = True
  174. [mypy-synapse.storage.util.*]
  175. disallow_untyped_defs = True
  176. [mypy-synapse.streams.*]
  177. disallow_untyped_defs = True
  178. [mypy-synapse.util.batching_queue]
  179. disallow_untyped_defs = True
  180. [mypy-synapse.util.caches.cached_call]
  181. disallow_untyped_defs = True
  182. [mypy-synapse.util.caches.dictionary_cache]
  183. disallow_untyped_defs = True
  184. [mypy-synapse.util.caches.lrucache]
  185. disallow_untyped_defs = True
  186. [mypy-synapse.util.caches.response_cache]
  187. disallow_untyped_defs = True
  188. [mypy-synapse.util.caches.stream_change_cache]
  189. disallow_untyped_defs = True
  190. [mypy-synapse.util.caches.ttl_cache]
  191. disallow_untyped_defs = True
  192. [mypy-synapse.util.daemonize]
  193. disallow_untyped_defs = True
  194. [mypy-synapse.util.file_consumer]
  195. disallow_untyped_defs = True
  196. [mypy-synapse.util.frozenutils]
  197. disallow_untyped_defs = True
  198. [mypy-synapse.util.hash]
  199. disallow_untyped_defs = True
  200. [mypy-synapse.util.httpresourcetree]
  201. disallow_untyped_defs = True
  202. [mypy-synapse.util.iterutils]
  203. disallow_untyped_defs = True
  204. [mypy-synapse.util.linked_list]
  205. disallow_untyped_defs = True
  206. [mypy-synapse.util.logcontext]
  207. disallow_untyped_defs = True
  208. [mypy-synapse.util.logformatter]
  209. disallow_untyped_defs = True
  210. [mypy-synapse.util.macaroons]
  211. disallow_untyped_defs = True
  212. [mypy-synapse.util.manhole]
  213. disallow_untyped_defs = True
  214. [mypy-synapse.util.module_loader]
  215. disallow_untyped_defs = True
  216. [mypy-synapse.util.msisdn]
  217. disallow_untyped_defs = True
  218. [mypy-synapse.util.patch_inline_callbacks]
  219. disallow_untyped_defs = True
  220. [mypy-synapse.util.ratelimitutils]
  221. disallow_untyped_defs = True
  222. [mypy-synapse.util.retryutils]
  223. disallow_untyped_defs = True
  224. [mypy-synapse.util.rlimit]
  225. disallow_untyped_defs = True
  226. [mypy-synapse.util.stringutils]
  227. disallow_untyped_defs = True
  228. [mypy-synapse.util.templates]
  229. disallow_untyped_defs = True
  230. [mypy-synapse.util.threepids]
  231. disallow_untyped_defs = True
  232. [mypy-synapse.util.wheel_timer]
  233. disallow_untyped_defs = True
  234. [mypy-synapse.util.versionstring]
  235. disallow_untyped_defs = True
  236. [mypy-tests.handlers.test_user_directory]
  237. disallow_untyped_defs = True
  238. [mypy-tests.storage.test_profile]
  239. disallow_untyped_defs = True
  240. [mypy-tests.storage.test_user_directory]
  241. disallow_untyped_defs = True
  242. [mypy-tests.rest.client.test_directory]
  243. disallow_untyped_defs = True
  244. ;; Dependencies without annotations
  245. ;; Before ignoring a module, check to see if type stubs are available.
  246. ;; The `typeshed` project maintains stubs here:
  247. ;; https://github.com/python/typeshed/tree/master/stubs
  248. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  249. ;; which we can pull in as a dev dependency by adding to `setup.py`'s
  250. ;; `CONDITIONAL_REQUIREMENTS["mypy"]` list.
  251. [mypy-authlib.*]
  252. ignore_missing_imports = True
  253. [mypy-bcrypt]
  254. ignore_missing_imports = True
  255. [mypy-canonicaljson]
  256. ignore_missing_imports = True
  257. [mypy-constantly]
  258. ignore_missing_imports = True
  259. [mypy-daemonize]
  260. ignore_missing_imports = True
  261. [mypy-h11]
  262. ignore_missing_imports = True
  263. [mypy-hiredis]
  264. ignore_missing_imports = True
  265. [mypy-hyperlink]
  266. ignore_missing_imports = True
  267. [mypy-ijson.*]
  268. ignore_missing_imports = True
  269. [mypy-jaeger_client.*]
  270. ignore_missing_imports = True
  271. [mypy-josepy.*]
  272. ignore_missing_imports = True
  273. [mypy-jwt.*]
  274. ignore_missing_imports = True
  275. [mypy-lxml]
  276. ignore_missing_imports = True
  277. [mypy-msgpack]
  278. ignore_missing_imports = True
  279. [mypy-nacl.*]
  280. ignore_missing_imports = True
  281. [mypy-netaddr]
  282. ignore_missing_imports = True
  283. [mypy-opentracing]
  284. ignore_missing_imports = True
  285. [mypy-parameterized.*]
  286. ignore_missing_imports = True
  287. [mypy-phonenumbers.*]
  288. ignore_missing_imports = True
  289. [mypy-prometheus_client.*]
  290. ignore_missing_imports = True
  291. [mypy-pymacaroons.*]
  292. ignore_missing_imports = True
  293. [mypy-pympler.*]
  294. ignore_missing_imports = True
  295. [mypy-rust_python_jaeger_reporter.*]
  296. ignore_missing_imports = True
  297. [mypy-saml2.*]
  298. ignore_missing_imports = True
  299. [mypy-sentry_sdk]
  300. ignore_missing_imports = True
  301. [mypy-service_identity.*]
  302. ignore_missing_imports = True
  303. [mypy-signedjson.*]
  304. ignore_missing_imports = True
  305. [mypy-treq.*]
  306. ignore_missing_imports = True
  307. [mypy-twisted.*]
  308. ignore_missing_imports = True
  309. [mypy-zope]
  310. ignore_missing_imports = True