[core] Enable ruff C4 (flake8-comprehensions) lint family (#16653)

This commit is contained in:
J. Nick Koston
2026-05-25 20:14:26 -05:00
committed by GitHub
parent bbc24ab546
commit b39b34bfe1
11 changed files with 22 additions and 27 deletions

View File

@@ -341,7 +341,7 @@ def lint_const_ordered(fname, content):
matching = [
(i + 1, line) for i, line in enumerate(lines) if line.startswith(start)
]
ordered = list(sorted(matching, key=lambda x: x[1].replace("_", " ")))
ordered = sorted(matching, key=lambda x: x[1].replace("_", " "))
ordered = [(mi, ol) for (mi, _), (_, ol) in zip(matching, ordered)]
for (mi, mline), (_, ol) in zip(matching, ordered):
if mline == ol:

View File

@@ -12,9 +12,9 @@ if __name__ == "__main__":
components = get_components_with_dependencies(files, True)
dump = {
"actions": sorted(list(ACTION_REGISTRY.keys())),
"conditions": sorted(list(CONDITION_REGISTRY.keys())),
"pin_providers": sorted(list(PIN_SCHEMA_REGISTRY.keys())),
"actions": sorted(ACTION_REGISTRY.keys()),
"conditions": sorted(CONDITION_REGISTRY.keys()),
"pin_providers": sorted(PIN_SCHEMA_REGISTRY.keys()),
}
print(json.dumps(dump, indent=2))