MCPcopy Index your code
hub / github.com/python/mypy / on_finish

Method on_finish

mypy/report.py:202–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

200 )
201
202 def on_finish(self) -> None:
203 counts: list[tuple[tuple[int, int, int, int], str]] = sorted(
204 ((c, p) for p, c in self.counts.items()), reverse=True
205 )
206 total_counts = tuple(sum(c[i] for c, p in counts) for i in range(4))
207 with open(os.path.join(self.output_dir, "linecount.txt"), "w") as f:
208 f.write("{:7} {:7} {:6} {:6} total\n".format(*total_counts))
209 for c, p in counts:
210 f.write(f"{c[0]:7} {c[1]:7} {c[2]:6} {c[3]:6} {p}\n")
211
212
213register_reporter("linecount", LineCountReporter)

Callers

nothing calls this directly

Calls 8

sortedFunction · 0.85
tupleClass · 0.85
sumFunction · 0.85
rangeClass · 0.85
itemsMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected