Enable error-code truthy-iterable [mypy 1.0] (#87596)

This commit is contained in:
Marc Mueller 2023-02-07 11:16:22 +01:00 committed by GitHub
parent aa00114c2f
commit 42008c50f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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",