More typing (#15449)

## Description:

More typing improvements.

Switch to using `mypy.ini` for flexibility

Add `warn_return_any` check except in `homeassistant.util.yaml` that does typing hacks. Fix some type annotations as resulting from this check and ignore others were fixing is hard.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
This commit is contained in:
Andrey
2018-07-13 20:14:45 +03:00
committed by GitHub
parent ae581694ac
commit e60f9ca392
8 changed files with 30 additions and 19 deletions

View File

@@ -25,7 +25,7 @@ def load_json(filename: str, default: Union[List, Dict, None] = None) \
"""
try:
with open(filename, encoding='utf-8') as fdesc:
return json.loads(fdesc.read())
return json.loads(fdesc.read()) # type: ignore
except FileNotFoundError:
# This is not a fatal error
_LOGGER.debug('JSON file not found: %s', filename)