Files
zulip/mypy.ini
Greg Price a8f66573f3 mypy: Switch back to a blanket ignore_missing_imports = True.
Since pushing this down to specific modules in 8ca31773c, we've
had to do bookkeeping here for every new dependency we add, unless
we add stubs for it at the same time -- which we never have.

That'd be fine if we were burning down this list and on track to
eliminate it soon, but we aren't.  So, go back to a global
acknowledgement that we have a lot of untyped dependencies.  The
stubs we do have will work just the same, and we can keep adding
more for whatever libraries we choose to.
2018-08-06 12:14:36 -07:00

219 lines
7.8 KiB
INI

[mypy]
# Logistics of what code to check and how to handle the data.
scripts_are_modules = True
show_traceback = True
mypy_path = stubs/
cache_dir = var/mypy-cache
# Options to make the checking stricter.
check_untyped_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
warn_no_return = True
no_implicit_optional = True
# The mypy daemon requires using local_partial_types.
local_partial_types = True
# It's useful to try this occasionally, and keep it clean; but when
# someone fixes a type error we don't want to add a burden for them.
#warn_unused_ignores = True
# Error on importing modules that are present but not part of the
# build. If the module can't reasonably be made to not error, errors
# can be suppressed with ignore_errors.
# (The mypy daemon only supports error and skip for follow_imports)
follow_imports = error
# 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
#
#
# IGNORE ERRORS
#
#
# We suppress all errors in a handful of files, all of them config files.
[mypy-conf] # For docs/conf.py.
ignore_errors = True
[mypy-zproject.settings]
ignore_errors = True
[mypy-zproject.test_settings]
ignore_errors = True
# zerver.tornado.autoreload is a slightly-patched piece of upstream Tornado.
[mypy-zerver.tornado.autoreload]
ignore_errors = True
#
#
# SKIP IMPORTS
#
#
[mypy-zulip]
# mypy is finding this module in the virtualenv. We should tell it
# about it on the command line; until we do, everything imported from
# it gets treated as Any, and we have to acknowledge it here.
#
# (The mypy daemon insists that everything it checks, it's told about
# in advance, which means setting follow_imports to either `skip` or
# `error`. Our global setting of `error` gets us an error if there's
# something it *could* check, because it can find the file, but we
# haven't told it to.)
follow_imports = skip
#
#
# STRICT OPTIONAL
#
#
strict_optional = True
# REQ returning None issue
[mypy-zerver.decorator]
strict_optional = False
[mypy-zerver.views.zephyr]
strict_optional = False
[mypy-zerver.views.user_settings]
strict_optional = False
[mypy-zerver.views.streams]
strict_optional = False
[mypy-zerver.views.storage]
strict_optional = False
[mypy-zerver.views.report]
strict_optional = False
[mypy-zerver.views.integrations]
strict_optional = False
[mypy-zerver.tornado.views]
strict_optional = False
[mypy-zerver.views.events_register]
strict_optional = False
[mypy-zerver.lib.webhooks.common]
strict_optional = False
[mypy-zerver.webhooks.yo.view]
strict_optional = False
[mypy-zerver.webhooks.transifex.view]
strict_optional = False
[mypy-zerver.webhooks.newrelic.view]
strict_optional = False
[mypy-zerver.webhooks.gogs.view]
strict_optional = False
[mypy-zerver.webhooks.gitlab.view]
strict_optional = False
[mypy-zerver.webhooks.github.view]
strict_optional = False
[mypy-zerver.webhooks.bitbucket.view]
strict_optional = False
[mypy-zerver.webhooks.bitbucket2.view]
strict_optional = False
[mypy-zerver.webhooks.beanstalk.view]
strict_optional = False
[mypy-zerver.views.auth] # Other issues in this file too
strict_optional = False
[mypy-zerver.views.realm] # Other issues in this file too
strict_optional = False
[mypy-zerver.views.messages] # Other issues in this file too
strict_optional = False
# One change required?
[mypy-zerver.migrations.0077_add_file_name_field_to_realm_emoji] #73: error: Argument 2 to "upload_files" of "Uploader" has incompatible type "Optional[bytes]"; expected "bytes"
strict_optional = False
[mypy-zilencer.management.commands.calculate_first_visible_message_id] #33: error: Argument 1 to "maybe_update_first_visible_message_id" has incompatible type "Optional[Realm]"; expected "Realm"
strict_optional = False
[mypy-zilencer.management.commands.add_new_realm] #22: error: List item 0 has incompatible type "Optional[Stream]"; expected "Stream"
strict_optional = False
# Re-architecting required?
[mypy-zerver.lib.queue] # Delayed setup of SimpleQueueClient.channel (Optional)
strict_optional = False
[mypy-zerver/management/commands/purge_queue] #24: error: Item "None" of "Optional[Any]" has no attribute "queue_purge"
strict_optional = False
[mypy-zerver.tornado.handlers] # Delayed setup of ASyncDjangoHandler._request_middleware (Optional), line 200 error
strict_optional = False
[mypy-zerver.tornado.descriptors] # line 10: 'get' can return None; only used in zerver/tornado/handlers?
strict_optional = False
# Tests (may be many issues in file; comment is just one error noted)
[mypy-zerver/tests/test_tornado] #202: error: Item "None" of "Optional[Morsel[Any]]" has no attribute "coded_value"
strict_optional = False
[mypy-zerver/tests/test_slack_importer] #70: error: Argument 1 to "MockResponse" has incompatible type "None"; expected "Dict[str, Any]"
strict_optional = False
[mypy-zerver/tests/test_service_bot_system] #312: error: Argument 1 to "set_bot_config" has incompatible type "Optional[UserProfile]"; expected "UserProfile"
strict_optional = False
[mypy-zerver/tests/test_outgoing_webhook_system] #33: error: Argument 1 to "MockServiceHandler" has incompatible type "None"; expected "str"
strict_optional = False
[mypy-zerver/tests/test_outgoing_webhook_interfaces] #22: error: Argument "user_profile" to "GenericOutgoingWebhookService" has incompatible type "None"; expected "UserProfile"
strict_optional = False
[mypy-zerver/tests/test_narrow] #515: error: Incompatible types in assignment (expression has type "None", variable has type "int")
strict_optional = False
[mypy-zerver/tests/test_logging_handlers] #73: error: Argument 7 to "makeRecord" of "Logger" has incompatible type "Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]"; expected "Union[Tuple[type, BaseException, TracebackType], Tuple[None, None, None], None]"
strict_optional = False
[mypy-zerver/tests/test_decorators] #1322: error: Item "None" of "Optional[Match[str]]" has no attribute "groupdict"
strict_optional = False
[mypy-zerver/tests/test_auth_backends] #2079: error: Incompatible types in assignment (expression has type "Optional[UserProfile]", variable has type "UserProfile")
strict_optional = False
[mypy-zerver/tests/test_signup] #1954: error: Item "None" of "Optional[Match[Any]]" has no attribute "groups"
strict_optional = False
[mypy-zerver/tests/test_realm] #191: error: Item "None" of "Optional[Stream]" has no attribute "id"
strict_optional = False
[mypy-zerver/tests/test_messages] #3070: error: Incompatible types in assignment (expression has type "None", variable has type "int")
strict_optional = False
[mypy-zerver/tests/test_events] #1365: error: Argument 2 to "do_set_realm_notifications_stream" has incompatible type "Optional[Stream]"; expected "Stream"
strict_optional = False
[mypy-zerver/tests/test_docs] #131: error: Argument 1 to "isfile" has incompatible type "Optional[str]"; expected "Union[bytes, str]"
strict_optional = False
# General exclusions to work on
[mypy-zerver.lib.test_helpers]
strict_optional = False
[mypy-zerver.lib.test_classes]
strict_optional = False
[mypy-zerver.tornado.event_queue]
strict_optional = False
[mypy-zerver.lib.outgoing_webhook]
strict_optional = False
[mypy-zerver.lib.bugdown] # for __init__.py
strict_optional = False
[mypy-zerver.lib.push_notifications]
strict_optional = False
[mypy-zerver.lib.actions]
strict_optional = False
[mypy-zproject.backends]
strict_optional = False
[mypy-zerver.worker.queue_processors]
strict_optional = False
[mypy-zerver.tornado.websocket_client]
strict_optional = False
[mypy-zerver.views.registration]
strict_optional = False
[mypy-tools.lib.html_branches]
strict_optional = False
[mypy-zthumbor.loaders.helpers]
strict_optional = False