[core] Enable ruff B (flake8-bugbear) lint family (#16655)

This commit is contained in:
J. Nick Koston
2026-05-25 21:28:14 -05:00
committed by GitHub
parent 489cf483d0
commit ae814cff5c
27 changed files with 54 additions and 50 deletions

View File

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