Mypy config cleanups (#25475)

* Move file specific config to inline comments

* Disallow untyped defs by default everywhere
This commit is contained in:
Ville Skyttä 2019-07-25 09:08:20 +03:00 committed by cgtobi
parent a50f1ae614
commit b230562c76
4 changed files with 8 additions and 15 deletions

View file

@ -14,6 +14,9 @@ from homeassistant.exceptions import HomeAssistantError, ConfigEntryNotReady
from homeassistant.setup import async_setup_component, async_process_deps_reqs
from homeassistant.util.decorator import Registry
# mypy: allow-untyped-defs
_LOGGER = logging.getLogger(__name__)
_UNDEF = object()

View file

@ -5,6 +5,8 @@ import yaml
from .objects import NodeListClass
# mypy: allow-untyped-calls, no-warn-return-any
def dump(_dict: dict) -> str:
"""Dump YAML to a string and remove null."""
return yaml.safe_dump(

View file

@ -24,6 +24,8 @@ from .const import _SECRET_NAMESPACE, SECRET_YAML
from .objects import NodeListClass, NodeStrClass
# mypy: allow-untyped-calls, no-warn-return-any
_LOGGER = logging.getLogger(__name__)
__SECRET_CACHE = {} # type: Dict[str, JSON_TYPE]

View file

@ -3,6 +3,7 @@ python_version = 3.5
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
follow_imports = silent
ignore_missing_imports = true
no_implicit_optional = true
@ -13,18 +14,3 @@ warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
[mypy-homeassistant.*]
disallow_untyped_defs = true
[mypy-homeassistant.config_entries]
disallow_untyped_defs = false
[mypy-homeassistant.util.yaml.dumper]
warn_return_any = false
disallow_untyped_calls = false
[mypy-homeassistant.util.yaml.loader]
warn_return_any = false
disallow_untyped_calls = false