MCPcopy Create free account
hub / github.com/pybind/pybind11 / run

Function run

tools/codespell_ignore_lines_from_errors.py:17–36  ·  view source on GitHub ↗
(args: list[str])

Source from the content-addressed store, hash-verified

15
16
17def run(args: list[str]) -> None:
18 assert len(args) == 1, "codespell_errors.txt"
19 cache = {}
20 done = set()
21 with open(args[0]) as f:
22 lines = f.read().splitlines()
23
24 for line in sorted(lines):
25 i = line.find(" ==> ")
26 if i > 0:
27 flds = line[:i].split(":")
28 if len(flds) >= 2:
29 filename, line_num = flds[:2]
30 if filename not in cache:
31 with open(filename) as f:
32 cache[filename] = f.read().splitlines()
33 supp = cache[filename][int(line_num) - 1]
34 if supp not in done:
35 print(supp)
36 done.add(supp)
37
38
39if __name__ == "__main__":

Calls 6

lenFunction · 0.85
printFunction · 0.85
findMethod · 0.80
setClass · 0.50
readMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected