mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:07:33 +00:00
[core] Enable ruff C4 (flake8-comprehensions) lint family (#16653)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user