1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-18 07:56:03 +01:00

Improve platforms pylint plugin (#164067)

This commit is contained in:
Joost Lekkerkerker
2026-02-25 16:15:28 +01:00
committed by GitHub
parent 2cfafc04ce
commit cb990823cd
6 changed files with 87 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ class HassEnforceSortedPlatformsChecker(BaseChecker):
"""Check for sorted PLATFORMS const."""
if (
isinstance(target, nodes.AssignName)
and target.name == "PLATFORMS"
and target.name in {"PLATFORMS", "_PLATFORMS"}
and isinstance(node.value, nodes.List)
):
platforms = [v.as_string() for v in node.value.elts]