mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-21 20:24:32 +03:00
eda735e4bb
### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
101 lines
2.7 KiB
INI
101 lines
2.7 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
|
|
|
|
# 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.9
|
|
|
|
files =
|
|
docker/,
|
|
scripts-dev/,
|
|
synapse/,
|
|
synmark/,
|
|
tests/,
|
|
build_rust.py
|
|
|
|
[mypy-synapse.metrics._reactor_metrics]
|
|
# This module pokes at the internals of OS-specific classes, to appease mypy
|
|
# on different systems we add additional ignores.
|
|
warn_unused_ignores = False
|
|
|
|
[mypy-synapse.util.caches.treecache]
|
|
disallow_untyped_defs = False
|
|
disallow_incomplete_defs = False
|
|
|
|
[mypy-synapse.util.manhole]
|
|
# This module imports something from Twisted which has a bad annotation in Twisted trunk,
|
|
# but is unannotated in Twisted's latest release. We want to type-ignore the problem
|
|
# in the twisted trunk job, even though it has no effect on normal mypy runs.
|
|
warn_unused_ignores = 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-pyperf.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-rust_python_jaeger_reporter.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-saml2.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-srvlookup.*]
|
|
ignore_missing_imports = True
|
|
|
|
# https://github.com/twisted/treq/pull/366
|
|
[mypy-treq.*]
|
|
ignore_missing_imports = True
|
|
|
|
[mypy-multipart.*]
|
|
ignore_missing_imports = True
|