mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
chore: move to Ruff and add rules (#4483)
This commit is contained in:
@@ -17,14 +17,18 @@ def run(args: List[str]) -> None:
|
||||
assert len(args) == 1, "codespell_errors.txt"
|
||||
cache = {}
|
||||
done = set()
|
||||
for line in sorted(open(args[0]).read().splitlines()):
|
||||
with open(args[0]) as f:
|
||||
lines = f.read().splitlines()
|
||||
|
||||
for line in sorted(lines):
|
||||
i = line.find(" ==> ")
|
||||
if i > 0:
|
||||
flds = line[:i].split(":")
|
||||
if len(flds) >= 2:
|
||||
filename, line_num = flds[:2]
|
||||
if filename not in cache:
|
||||
cache[filename] = open(filename).read().splitlines()
|
||||
with open(filename) as f:
|
||||
cache[filename] = f.read().splitlines()
|
||||
supp = cache[filename][int(line_num) - 1]
|
||||
if supp not in done:
|
||||
print(supp)
|
||||
|
||||
Reference in New Issue
Block a user