You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

185 lines
4.2 KiB

  1. [mypy]
  2. namespace_packages = True
  3. plugins = pydantic.mypy, 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. warn_unused_ignores = True
  11. local_partial_types = True
  12. no_implicit_optional = True
  13. disallow_untyped_defs = True
  14. strict_equality = True
  15. warn_redundant_casts = True
  16. files =
  17. docker/,
  18. scripts-dev/,
  19. synapse/,
  20. tests/,
  21. build_rust.py
  22. # Note: Better exclusion syntax coming in mypy > 0.910
  23. # https://github.com/python/mypy/pull/11329
  24. #
  25. # For now, set the (?x) flag enable "verbose" regexes
  26. # https://docs.python.org/3/library/re.html#re.X
  27. exclude = (?x)
  28. ^(
  29. |synapse/storage/databases/__init__.py
  30. |synapse/storage/databases/main/cache.py
  31. |synapse/storage/schema/
  32. |tests/api/test_auth.py
  33. |tests/app/test_openid_listener.py
  34. |tests/appservice/test_scheduler.py
  35. |tests/federation/test_federation_catch_up.py
  36. |tests/federation/test_federation_sender.py
  37. |tests/http/federation/test_matrix_federation_agent.py
  38. |tests/http/federation/test_srv_resolver.py
  39. |tests/http/test_proxyagent.py
  40. |tests/module_api/test_api.py
  41. |tests/rest/media/v1/test_media_storage.py
  42. |tests/server.py
  43. |tests/test_state.py
  44. |tests/test_terms_auth.py
  45. )$
  46. [mypy-synapse.federation.transport.client]
  47. disallow_untyped_defs = False
  48. [mypy-synapse.http.client]
  49. disallow_untyped_defs = False
  50. [mypy-synapse.http.matrixfederationclient]
  51. disallow_untyped_defs = False
  52. [mypy-synapse.metrics._reactor_metrics]
  53. disallow_untyped_defs = False
  54. # This module imports select.epoll. That exists on Linux, but doesn't on macOS.
  55. # See https://github.com/matrix-org/synapse/pull/11771.
  56. warn_unused_ignores = False
  57. [mypy-synapse.util.caches.treecache]
  58. disallow_untyped_defs = False
  59. [mypy-synapse.server]
  60. disallow_untyped_defs = False
  61. [mypy-synapse.storage.database]
  62. disallow_untyped_defs = False
  63. [mypy-tests.*]
  64. disallow_untyped_defs = False
  65. [mypy-tests.config.*]
  66. disallow_untyped_defs = True
  67. [mypy-tests.crypto.*]
  68. disallow_untyped_defs = True
  69. [mypy-tests.events.*]
  70. disallow_untyped_defs = True
  71. [mypy-tests.federation.transport.test_client]
  72. disallow_untyped_defs = True
  73. [mypy-tests.handlers.*]
  74. disallow_untyped_defs = True
  75. [mypy-tests.logging.*]
  76. disallow_untyped_defs = True
  77. [mypy-tests.metrics.*]
  78. disallow_untyped_defs = True
  79. [mypy-tests.push.*]
  80. disallow_untyped_defs = True
  81. [mypy-tests.rest.*]
  82. disallow_untyped_defs = True
  83. [mypy-tests.state.test_profile]
  84. disallow_untyped_defs = True
  85. [mypy-tests.storage.*]
  86. disallow_untyped_defs = True
  87. [mypy-tests.test_server]
  88. disallow_untyped_defs = True
  89. [mypy-tests.types.*]
  90. disallow_untyped_defs = True
  91. [mypy-tests.util.caches.*]
  92. disallow_untyped_defs = True
  93. [mypy-tests.util.caches.test_descriptors]
  94. disallow_untyped_defs = False
  95. [mypy-tests.util.*]
  96. disallow_untyped_defs = True
  97. [mypy-tests.utils]
  98. disallow_untyped_defs = True
  99. ;; Dependencies without annotations
  100. ;; Before ignoring a module, check to see if type stubs are available.
  101. ;; The `typeshed` project maintains stubs here:
  102. ;; https://github.com/python/typeshed/tree/master/stubs
  103. ;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
  104. ;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
  105. ;; `[tool.poetry.dev-dependencies]` list.
  106. [mypy-authlib.*]
  107. ignore_missing_imports = True
  108. [mypy-canonicaljson]
  109. ignore_missing_imports = True
  110. [mypy-ijson.*]
  111. ignore_missing_imports = True
  112. [mypy-lxml]
  113. ignore_missing_imports = True
  114. [mypy-msgpack]
  115. ignore_missing_imports = True
  116. # Note: WIP stubs available at
  117. # https://github.com/microsoft/python-type-stubs/tree/64934207f523ad6b611e6cfe039d85d7175d7d0d/netaddr
  118. [mypy-netaddr]
  119. ignore_missing_imports = True
  120. [mypy-parameterized.*]
  121. ignore_missing_imports = True
  122. [mypy-pymacaroons.*]
  123. ignore_missing_imports = True
  124. [mypy-pympler.*]
  125. ignore_missing_imports = True
  126. [mypy-rust_python_jaeger_reporter.*]
  127. ignore_missing_imports = True
  128. [mypy-saml2.*]
  129. ignore_missing_imports = True
  130. [mypy-service_identity.*]
  131. ignore_missing_imports = True
  132. [mypy-srvlookup.*]
  133. ignore_missing_imports = True
  134. [mypy-treq.*]
  135. ignore_missing_imports = True
  136. [mypy-incremental.*]
  137. ignore_missing_imports = True
  138. [mypy-setuptools_rust.*]
  139. ignore_missing_imports = True