mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-15 22:42:23 +01:00
6f18812bb0
The stubs have some issues so this has some generous cast and ignores in it, but it is better than not having stubs. Note that confusing that Element is a function which creates _Element instances (and similarly for Comment).
97 lines
2.5 KiB
INI
97 lines
2.5 KiB
INI
[mypy]
|
|
namespace_packages = True
|
|
plugins = pydantic.mypy, mypy_zope:plugin, scripts-dev/mypy_synapse_plugin.py
|
|
follow_imports = normal
|
|
show_error_codes = True
|
|
show_traceback = True
|
|
mypy_path = stubs
|
|
warn_unreachable = True
|
|
local_partial_types = True
|
|
no_implicit_optional = True
|
|
|
|
# Strict checks, see mypy --help
|
|
warn_unused_configs = True
|
|
# disallow_any_generics = True
|
|
disallow_subclassing_any = True
|
|
# disallow_untyped_calls = True
|
|
disallow_untyped_defs = True
|
|
disallow_incomplete_defs = True
|
|
# check_untyped_defs = True
|
|
# disallow_untyped_decorators = True
|
|
warn_redundant_casts = True
|
|
warn_unused_ignores = True
|
|
# warn_return_any = True
|
|
# no_implicit_reexport = True
|
|
strict_equality = True
|
|
strict_concatenate = True
|
|
|
|
# Run mypy type checking with the minimum supported Python version to catch new usage
|
|
# that isn't backwards-compatible (types, overloads, etc).
|
|
python_version = 3.8
|
|
|
|
files =
|
|
docker/,
|
|
scripts-dev/,
|
|
synapse/,
|
|
tests/,
|
|
build_rust.py
|
|
|
|
[mypy-synapse.metrics._reactor_metrics]
|
|
# This module imports select.epoll. That exists on Linux, but doesn't on macOS.
|
|
# See https://github.com/matrix-org/synapse/pull/11771.
|
|
warn_unused_ignores = False
|
|
|
|
[mypy-synapse.util.caches.treecache]
|
|
disallow_untyped_defs = False
|
|
disallow_incomplete_defs = False
|
|
|
|
;; Dependencies without annotations
|
|
;; Before ignoring a module, check to see if type stubs are available.
|
|
;; The `typeshed` project maintains stubs here:
|
|
;; https://github.com/python/typeshed/tree/master/stubs
|
|
;; and for each package `foo` there's a corresponding `types-foo` package on PyPI,
|
|
;; which we can pull in as a dev dependency by adding to `pyproject.toml`'s
|
|
;; `[tool.poetry.dev-dependencies]` list.
|
|
|
|
# https://github.com/lepture/authlib/issues/460
|
|
[mypy-authlib.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-ijson.*]
|
|
ignore_missing_imports = True
|
|
|
|
# https://github.com/msgpack/msgpack-python/issues/448
|
|
[mypy-msgpack]
|
|
ignore_missing_imports = True
|
|
|
|
# https://github.com/wolever/parameterized/issues/143
|
|
[mypy-parameterized.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pymacaroons.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-pympler.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-rust_python_jaeger_reporter.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-saml2.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-service_identity.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-srvlookup.*]
|
|
ignore_missing_imports = True
|
|
|
|
# https://github.com/twisted/treq/pull/366
|
|
[mypy-treq.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-incremental.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-setuptools_rust.*]
|
|
ignore_missing_imports = True
|