mirror of
https://github.com/home-assistant/core
synced 2024-07-21 02:25:24 +00:00
Enable error-code truthy-iterable
[mypy 1.0] (#87596)
This commit is contained in:
parent
aa00114c2f
commit
42008c50f3
|
@ -418,7 +418,7 @@ class EntityPlatform:
|
|||
This method must be run in the event loop.
|
||||
"""
|
||||
# handle empty list from component/platform
|
||||
if not new_entities:
|
||||
if not new_entities: # type: ignore[truthy-iterable]
|
||||
return
|
||||
|
||||
hass = self.hass
|
||||
|
|
2
mypy.ini
2
mypy.ini
|
@ -14,7 +14,7 @@ warn_incomplete_stub = true
|
|||
warn_redundant_casts = true
|
||||
warn_unused_configs = true
|
||||
warn_unused_ignores = true
|
||||
enable_error_code = ignore-without-code
|
||||
enable_error_code = ignore-without-code, truthy-iterable
|
||||
disable_error_code = annotation-unchecked
|
||||
strict_concatenate = false
|
||||
check_untyped_defs = true
|
||||
|
|
|
@ -48,7 +48,7 @@ GENERAL_SETTINGS: Final[dict[str, str]] = {
|
|||
"warn_redundant_casts": "true",
|
||||
"warn_unused_configs": "true",
|
||||
"warn_unused_ignores": "true",
|
||||
"enable_error_code": ", ".join(["ignore-without-code"]),
|
||||
"enable_error_code": ", ".join(["ignore-without-code", "truthy-iterable"]),
|
||||
"disable_error_code": ", ".join(["annotation-unchecked"]),
|
||||
# Strict_concatenate breaks passthrough ParamSpec typing
|
||||
"strict_concatenate": "false",
|
||||
|
|
Loading…
Reference in a new issue