mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:09:12 +00:00
[core] Enable ruff B (flake8-bugbear) lint family (#16655)
This commit is contained in:
@@ -342,8 +342,8 @@ def lint_const_ordered(fname, content):
|
||||
(i + 1, line) for i, line in enumerate(lines) if line.startswith(start)
|
||||
]
|
||||
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):
|
||||
ordered = [(mi, ol) for (mi, _), (_, ol) in zip(matching, ordered, strict=True)]
|
||||
for (mi, mline), (_, ol) in zip(matching, ordered, strict=True):
|
||||
if mline == ol:
|
||||
continue
|
||||
target = next(i for i, line in ordered if line == mline)
|
||||
|
||||
Reference in New Issue
Block a user