mypy.ini 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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/group_server.py
  35. |synapse/storage/databases/main/metrics.py
  36. |synapse/storage/databases/main/monthly_active_users.py
  37. |synapse/storage/databases/main/presence.py
  38. |synapse/storage/databases/main/purge_events.py
  39. |synapse/storage/databases/main/push_rule.py
  40. |synapse/storage/databases/main/receipts.py
  41. |synapse/storage/databases/main/room.py
  42. |synapse/storage/databases/main/roommember.py
  43. |synapse/storage/databases/main/search.py
  44. |synapse/storage/databases/main/state.py
  45. |synapse/storage/databases/main/stats.py
  46. |synapse/storage/databases/main/transactions.py
  47. |synapse/storage/databases/main/user_directory.py
  48. |synapse/storage/schema/
  49. |tests/api/test_auth.py
  50. |tests/api/test_ratelimiting.py
  51. |tests/app/test_openid_listener.py
  52. |tests/appservice/test_scheduler.py
  53. |tests/config/test_cache.py
  54. |tests/config/test_tls.py
  55. |tests/crypto/test_keyring.py
  56. |tests/events/test_presence_router.py
  57. |tests/events/test_utils.py
  58. |tests/federation/test_federation_catch_up.py
  59. |tests/federation/test_federation_sender.py
  60. |tests/federation/test_federation_server.py
  61. |tests/federation/transport/test_knocking.py
  62. |tests/federation/transport/test_server.py
  63. |tests/handlers/test_cas.py
  64. |tests/handlers/test_directory.py
  65. |tests/handlers/test_e2e_keys.py
  66. |tests/handlers/test_federation.py
  67. |tests/handlers/test_oidc.py
  68. |tests/handlers/test_presence.py
  69. |tests/handlers/test_profile.py
  70. |tests/handlers/test_saml.py
  71. |tests/handlers/test_typing.py
  72. |tests/http/federation/test_matrix_federation_agent.py
  73. |tests/http/federation/test_srv_resolver.py
  74. |tests/http/test_fedclient.py
  75. |tests/http/test_proxyagent.py
  76. |tests/http/test_servlet.py
  77. |tests/http/test_site.py
  78. |tests/logging/__init__.py
  79. |tests/logging/test_terse_json.py
  80. |tests/module_api/test_api.py
  81. |tests/push/test_email.py
  82. |tests/push/test_http.py
  83. |tests/push/test_presentable_names.py
  84. |tests/push/test_push_rule_evaluator.py
  85. |tests/rest/admin/test_admin.py
  86. |tests/rest/admin/test_user.py
  87. |tests/rest/admin/test_username_available.py
  88. |tests/rest/client/test_account.py
  89. |tests/rest/client/test_events.py
  90. |tests/rest/client/test_filter.py
  91. |tests/rest/client/test_groups.py
  92. |tests/rest/client/test_register.py
  93. |tests/rest/client/test_report_event.py
  94. |tests/rest/client/test_rooms.py
  95. |tests/rest/client/test_third_party_rules.py
  96. |tests/rest/client/test_transactions.py
  97. |tests/rest/client/test_typing.py
  98. |tests/rest/client/utils.py
  99. |tests/rest/key/v2/test_remote_key_resource.py
  100. |tests/rest/media/v1/test_base.py
  101. |tests/rest/media/v1/test_media_storage.py
  102. |tests/rest/media/v1/test_url_preview.py
  103. |tests/scripts/test_new_matrix_user.py
  104. |tests/server.py
  105. |tests/server_notices/test_resource_limits_server_notices.py
  106. |tests/state/test_v2.py
  107. |tests/storage/test_account_data.py
  108. |tests/storage/test_background_update.py
  109. |tests/storage/test_base.py
  110. |tests/storage/test_client_ips.py
  111. |tests/storage/test_database.py
  112. |tests/storage/test_event_federation.py
  113. |tests/storage/test_id_generators.py
  114. |tests/storage/test_roommember.py
  115. |tests/test_metrics.py
  116. |tests/test_phone_home.py
  117. |tests/test_server.py
  118. |tests/test_state.py
  119. |tests/test_terms_auth.py
  120. |tests/unittest.py
  121. |tests/util/caches/test_cached_call.py
  122. |tests/util/caches/test_deferred_cache.py
  123. |tests/util/caches/test_descriptors.py
  124. |tests/util/caches/test_response_cache.py
  125. |tests/util/caches/test_ttlcache.py
  126. |tests/util/test_async_helpers.py
  127. |tests/util/test_batching_queue.py
  128. |tests/util/test_dict_cache.py
  129. |tests/util/test_expiring_cache.py
  130. |tests/util/test_file_consumer.py
  131. |tests/util/test_linearizer.py
  132. |tests/util/test_logcontext.py
  133. |tests/util/test_lrucache.py
  134. |tests/util/test_rwlock.py
  135. |tests/util/test_wheel_timer.py
  136. |tests/utils.py
  137. )$
  138. [mypy-synapse.api.*]
  139. disallow_untyped_defs = True
  140. [mypy-synapse.app.*]
  141. disallow_untyped_defs = True
  142. [mypy-synapse.config._base]
  143. disallow_untyped_defs = True
  144. [mypy-synapse.crypto.*]
  145. disallow_untyped_defs = True
  146. [mypy-synapse.events.*]
  147. disallow_untyped_defs = True
  148. [mypy-synapse.federation.*]
  149. disallow_untyped_defs = True
  150. [mypy-synapse.federation.transport.client]
  151. disallow_untyped_defs = False
  152. [mypy-synapse.handlers.*]
  153. disallow_untyped_defs = True
  154. [mypy-synapse.metrics.*]
  155. disallow_untyped_defs = True
  156. [mypy-synapse.module_api.*]
  157. disallow_untyped_defs = True
  158. [mypy-synapse.push.*]
  159. disallow_untyped_defs = True
  160. [mypy-synapse.rest.*]
  161. disallow_untyped_defs = True
  162. [mypy-synapse.server_notices.*]
  163. disallow_untyped_defs = True
  164. [mypy-synapse.state.*]
  165. disallow_untyped_defs = True
  166. [mypy-synapse.storage.databases.main.client_ips]
  167. disallow_untyped_defs = True
  168. [mypy-synapse.storage.databases.main.directory]
  169. disallow_untyped_defs = True
  170. [mypy-synapse.storage.databases.main.events_worker]
  171. disallow_untyped_defs = True
  172. [mypy-synapse.storage.databases.main.room_batch]
  173. disallow_untyped_defs = True
  174. [mypy-synapse.storage.databases.main.profile]
  175. disallow_untyped_defs = True
  176. [mypy-synapse.storage.databases.main.state_deltas]
  177. disallow_untyped_defs = True
  178. [mypy-synapse.storage.databases.main.user_erasure_store]
  179. disallow_untyped_defs = True
  180. [mypy-synapse.storage.util.*]
  181. disallow_untyped_defs = True
  182. [mypy-synapse.streams.*]
  183. disallow_untyped_defs = True
  184. [mypy-synapse.util.*]
  185. disallow_untyped_defs = True
  186. [mypy-synapse.util.caches.treecache]
  187. disallow_untyped_defs = False
  188. [mypy-tests.handlers.test_user_directory]
  189. disallow_untyped_defs = True
  190. [mypy-tests.storage.test_profile]
  191. disallow_untyped_defs = True
  192. [mypy-tests.storage.test_user_directory]
  193. disallow_untyped_defs = True
  194. [mypy-tests.rest.client.test_directory]
  195. disallow_untyped_defs = True
  196. [mypy-tests.federation.transport.test_client]
  197. disallow_untyped_defs = True
  198. ;; Dependencies without annotations
  199. ;; Before ignoring a module, check to see if type stubs are available.
  200. ;; The `typeshed` project maintains stubs here:
  201. ;; https://github.com/python/typeshed/tree/master/stubs
  202. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  203. ;; which we can pull in as a dev dependency by adding to `setup.py`'s
  204. ;; `CONDITIONAL_REQUIREMENTS["mypy"]` list.
  205. [mypy-authlib.*]
  206. ignore_missing_imports = True
  207. [mypy-bcrypt]
  208. ignore_missing_imports = True
  209. [mypy-canonicaljson]
  210. ignore_missing_imports = True
  211. [mypy-constantly]
  212. ignore_missing_imports = True
  213. [mypy-daemonize]
  214. ignore_missing_imports = True
  215. [mypy-h11]
  216. ignore_missing_imports = True
  217. [mypy-hiredis]
  218. ignore_missing_imports = True
  219. [mypy-hyperlink]
  220. ignore_missing_imports = True
  221. [mypy-ijson.*]
  222. ignore_missing_imports = True
  223. [mypy-jaeger_client.*]
  224. ignore_missing_imports = True
  225. [mypy-josepy.*]
  226. ignore_missing_imports = True
  227. [mypy-jwt.*]
  228. ignore_missing_imports = True
  229. [mypy-lxml]
  230. ignore_missing_imports = True
  231. [mypy-msgpack]
  232. ignore_missing_imports = True
  233. [mypy-nacl.*]
  234. ignore_missing_imports = True
  235. [mypy-netaddr]
  236. ignore_missing_imports = True
  237. [mypy-opentracing]
  238. ignore_missing_imports = True
  239. [mypy-parameterized.*]
  240. ignore_missing_imports = True
  241. [mypy-phonenumbers.*]
  242. ignore_missing_imports = True
  243. [mypy-prometheus_client.*]
  244. ignore_missing_imports = True
  245. [mypy-pymacaroons.*]
  246. ignore_missing_imports = True
  247. [mypy-pympler.*]
  248. ignore_missing_imports = True
  249. [mypy-rust_python_jaeger_reporter.*]
  250. ignore_missing_imports = True
  251. [mypy-saml2.*]
  252. ignore_missing_imports = True
  253. [mypy-sentry_sdk]
  254. ignore_missing_imports = True
  255. [mypy-service_identity.*]
  256. ignore_missing_imports = True
  257. [mypy-signedjson.*]
  258. ignore_missing_imports = True
  259. [mypy-treq.*]
  260. ignore_missing_imports = True
  261. [mypy-twisted.*]
  262. ignore_missing_imports = True
  263. [mypy-zope]
  264. ignore_missing_imports = True