mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 02:19:31 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user