2018-03-22 18:33:37 +01:00
|
|
|
[mypy]
|
2018-05-06 23:16:36 +02:00
|
|
|
# Logistics of what code to check and how to handle the data.
|
|
|
|
scripts_are_modules = True
|
|
|
|
show_traceback = True
|
2018-12-17 19:27:51 +01:00
|
|
|
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-stubs-for-third-party-modules
|
|
|
|
# for notes on how we manage mypy stubs.
|
2021-03-04 22:11:52 +01:00
|
|
|
mypy_path = $MYPY_CONFIG_FILE_DIR/stubs
|
|
|
|
cache_dir = $MYPY_CONFIG_FILE_DIR/var/mypy-cache
|
2018-05-06 23:16:36 +02:00
|
|
|
|
|
|
|
# Options to make the checking stricter.
|
2018-03-23 21:32:12 +01:00
|
|
|
check_untyped_defs = True
|
2018-05-06 23:23:57 +02:00
|
|
|
disallow_untyped_defs = True
|
2018-03-23 21:32:12 +01:00
|
|
|
disallow_any_generics = True
|
2018-05-06 23:16:36 +02:00
|
|
|
warn_no_return = True
|
2020-07-05 03:00:50 +02:00
|
|
|
strict_optional = True
|
2018-03-23 23:43:58 +01:00
|
|
|
no_implicit_optional = True
|
2020-06-16 23:29:42 +02:00
|
|
|
warn_redundant_casts = True
|
2020-06-16 23:33:26 +02:00
|
|
|
warn_unused_ignores = True
|
2018-03-22 18:33:37 +01:00
|
|
|
|
2020-04-22 04:13:37 +02:00
|
|
|
# Display the codes needed for # type: ignore[code] annotations.
|
|
|
|
show_error_codes = True
|
|
|
|
|
2018-08-06 21:14:36 +02:00
|
|
|
# We use a lot of third-party libraries we don't have stubs for, as
|
|
|
|
# well as a handful of our own modules that we haven't told mypy how
|
|
|
|
# to find. Ignore them. (For some details, see:
|
|
|
|
# `git log -p -S ignore_missing_imports mypy.ini`.)
|
|
|
|
#
|
|
|
|
# This doesn't get in the way of using the stubs we *do* have.
|
|
|
|
ignore_missing_imports = True
|
|
|
|
|
2019-08-03 02:16:06 +02:00
|
|
|
# Warn of unreachable or redundant code.
|
|
|
|
warn_unreachable = True
|