mypy.ini 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. # To find all folders that pass mypy you run:
  13. #
  14. # find synapse/* -type d -not -name __pycache__ -exec bash -c "mypy '{}' > /dev/null" \; -print
  15. files =
  16. scripts-dev/sign_json,
  17. synapse/__init__.py,
  18. synapse/api,
  19. synapse/appservice,
  20. synapse/config,
  21. synapse/crypto,
  22. synapse/event_auth.py,
  23. synapse/events,
  24. synapse/federation,
  25. synapse/groups,
  26. synapse/handlers,
  27. synapse/http,
  28. synapse/logging,
  29. synapse/metrics,
  30. synapse/module_api,
  31. synapse/notifier.py,
  32. synapse/push,
  33. synapse/replication,
  34. synapse/rest,
  35. synapse/server.py,
  36. synapse/server_notices,
  37. synapse/spam_checker_api,
  38. synapse/state,
  39. synapse/storage/__init__.py,
  40. synapse/storage/_base.py,
  41. synapse/storage/background_updates.py,
  42. synapse/storage/databases/main/appservice.py,
  43. synapse/storage/databases/main/client_ips.py,
  44. synapse/storage/databases/main/events.py,
  45. synapse/storage/databases/main/keys.py,
  46. synapse/storage/databases/main/pusher.py,
  47. synapse/storage/databases/main/registration.py,
  48. synapse/storage/databases/main/relations.py,
  49. synapse/storage/databases/main/session.py,
  50. synapse/storage/databases/main/stream.py,
  51. synapse/storage/databases/main/ui_auth.py,
  52. synapse/storage/databases/state,
  53. synapse/storage/database.py,
  54. synapse/storage/engines,
  55. synapse/storage/keys.py,
  56. synapse/storage/persist_events.py,
  57. synapse/storage/prepare_database.py,
  58. synapse/storage/purge_events.py,
  59. synapse/storage/push_rule.py,
  60. synapse/storage/relations.py,
  61. synapse/storage/roommember.py,
  62. synapse/storage/state.py,
  63. synapse/storage/types.py,
  64. synapse/storage/util,
  65. synapse/streams,
  66. synapse/types.py,
  67. synapse/util,
  68. synapse/visibility.py,
  69. tests/replication,
  70. tests/test_event_auth.py,
  71. tests/test_utils,
  72. tests/handlers/test_password_providers.py,
  73. tests/handlers/test_room.py,
  74. tests/handlers/test_room_summary.py,
  75. tests/handlers/test_send_email.py,
  76. tests/handlers/test_sync.py,
  77. tests/handlers/test_user_directory.py,
  78. tests/rest/client/test_login.py,
  79. tests/rest/client/test_auth.py,
  80. tests/rest/client/test_relations.py,
  81. tests/rest/media/v1/test_filepath.py,
  82. tests/rest/media/v1/test_oembed.py,
  83. tests/storage/test_state.py,
  84. tests/storage/test_user_directory.py,
  85. tests/util/test_itertools.py,
  86. tests/util/test_stream_change_cache.py
  87. [mypy-synapse.api.*]
  88. disallow_untyped_defs = True
  89. [mypy-synapse.crypto.*]
  90. disallow_untyped_defs = True
  91. [mypy-synapse.events.*]
  92. disallow_untyped_defs = True
  93. [mypy-synapse.handlers.*]
  94. disallow_untyped_defs = True
  95. [mypy-synapse.push.*]
  96. disallow_untyped_defs = True
  97. [mypy-synapse.rest.*]
  98. disallow_untyped_defs = True
  99. [mypy-synapse.server_notices.*]
  100. disallow_untyped_defs = True
  101. [mypy-synapse.state.*]
  102. disallow_untyped_defs = True
  103. [mypy-synapse.storage.databases.main.client_ips]
  104. disallow_untyped_defs = True
  105. [mypy-synapse.storage.util.*]
  106. disallow_untyped_defs = True
  107. [mypy-synapse.streams.*]
  108. disallow_untyped_defs = True
  109. [mypy-synapse.util.batching_queue]
  110. disallow_untyped_defs = True
  111. [mypy-synapse.util.caches.cached_call]
  112. disallow_untyped_defs = True
  113. [mypy-synapse.util.caches.dictionary_cache]
  114. disallow_untyped_defs = True
  115. [mypy-synapse.util.caches.lrucache]
  116. disallow_untyped_defs = True
  117. [mypy-synapse.util.caches.response_cache]
  118. disallow_untyped_defs = True
  119. [mypy-synapse.util.caches.stream_change_cache]
  120. disallow_untyped_defs = True
  121. [mypy-synapse.util.caches.ttl_cache]
  122. disallow_untyped_defs = True
  123. [mypy-synapse.util.daemonize]
  124. disallow_untyped_defs = True
  125. [mypy-synapse.util.file_consumer]
  126. disallow_untyped_defs = True
  127. [mypy-synapse.util.frozenutils]
  128. disallow_untyped_defs = True
  129. [mypy-synapse.util.hash]
  130. disallow_untyped_defs = True
  131. [mypy-synapse.util.httpresourcetree]
  132. disallow_untyped_defs = True
  133. [mypy-synapse.util.iterutils]
  134. disallow_untyped_defs = True
  135. [mypy-synapse.util.linked_list]
  136. disallow_untyped_defs = True
  137. [mypy-synapse.util.logcontext]
  138. disallow_untyped_defs = True
  139. [mypy-synapse.util.logformatter]
  140. disallow_untyped_defs = True
  141. [mypy-synapse.util.macaroons]
  142. disallow_untyped_defs = True
  143. [mypy-synapse.util.manhole]
  144. disallow_untyped_defs = True
  145. [mypy-synapse.util.module_loader]
  146. disallow_untyped_defs = True
  147. [mypy-synapse.util.msisdn]
  148. disallow_untyped_defs = True
  149. [mypy-synapse.util.patch_inline_callbacks]
  150. disallow_untyped_defs = True
  151. [mypy-synapse.util.ratelimitutils]
  152. disallow_untyped_defs = True
  153. [mypy-synapse.util.retryutils]
  154. disallow_untyped_defs = True
  155. [mypy-synapse.util.rlimit]
  156. disallow_untyped_defs = True
  157. [mypy-synapse.util.stringutils]
  158. disallow_untyped_defs = True
  159. [mypy-synapse.util.templates]
  160. disallow_untyped_defs = True
  161. [mypy-synapse.util.threepids]
  162. disallow_untyped_defs = True
  163. [mypy-synapse.util.wheel_timer]
  164. disallow_untyped_defs = True
  165. [mypy-synapse.util.versionstring]
  166. disallow_untyped_defs = True
  167. [mypy-tests.handlers.test_user_directory]
  168. disallow_untyped_defs = True
  169. [mypy-tests.storage.test_user_directory]
  170. disallow_untyped_defs = True
  171. ;; Dependencies without annotations
  172. ;; Before ignoring a module, check to see if type stubs are available.
  173. ;; The `typeshed` project maintains stubs here:
  174. ;; https://github.com/python/typeshed/tree/master/stubs
  175. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  176. ;; which we can pull in as a dev dependency by adding to `setup.py`'s
  177. ;; `CONDITIONAL_REQUIREMENTS["mypy"]` list.
  178. [mypy-authlib.*]
  179. ignore_missing_imports = True
  180. [mypy-bcrypt]
  181. ignore_missing_imports = True
  182. [mypy-canonicaljson]
  183. ignore_missing_imports = True
  184. [mypy-constantly]
  185. ignore_missing_imports = True
  186. [mypy-daemonize]
  187. ignore_missing_imports = True
  188. [mypy-h11]
  189. ignore_missing_imports = True
  190. [mypy-hiredis]
  191. ignore_missing_imports = True
  192. [mypy-hyperlink]
  193. ignore_missing_imports = True
  194. [mypy-ijson.*]
  195. ignore_missing_imports = True
  196. [mypy-jaeger_client.*]
  197. ignore_missing_imports = True
  198. [mypy-josepy.*]
  199. ignore_missing_imports = True
  200. [mypy-jwt.*]
  201. ignore_missing_imports = True
  202. [mypy-lxml]
  203. ignore_missing_imports = True
  204. [mypy-msgpack]
  205. ignore_missing_imports = True
  206. [mypy-nacl.*]
  207. ignore_missing_imports = True
  208. [mypy-netaddr]
  209. ignore_missing_imports = True
  210. [mypy-opentracing]
  211. ignore_missing_imports = True
  212. [mypy-phonenumbers.*]
  213. ignore_missing_imports = True
  214. [mypy-prometheus_client.*]
  215. ignore_missing_imports = True
  216. [mypy-pymacaroons.*]
  217. ignore_missing_imports = True
  218. [mypy-pympler.*]
  219. ignore_missing_imports = True
  220. [mypy-rust_python_jaeger_reporter.*]
  221. ignore_missing_imports = True
  222. [mypy-saml2.*]
  223. ignore_missing_imports = True
  224. [mypy-sentry_sdk]
  225. ignore_missing_imports = True
  226. [mypy-service_identity.*]
  227. ignore_missing_imports = True
  228. [mypy-signedjson.*]
  229. ignore_missing_imports = True
  230. [mypy-treq.*]
  231. ignore_missing_imports = True
  232. [mypy-twisted.*]
  233. ignore_missing_imports = True
  234. [mypy-zope]
  235. ignore_missing_imports = True