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

Method on_file

mypy/report.py:732–747  ·  view source on GitHub ↗
(
        self,
        tree: MypyFile,
        modules: dict[str, MypyFile],
        type_map: dict[Expression, Type],
        options: Options,
    )

Source from the content-addressed store, hash-verified

730 """
731
732 def on_file(
733 self,
734 tree: MypyFile,
735 modules: dict[str, MypyFile],
736 type_map: dict[Expression, Type],
737 options: Options,
738 ) -> None:
739 last_xml = self.memory_xml.last_xml
740 if last_xml is None:
741 return
742 path = os.path.relpath(tree.path)
743 if path.startswith(".."):
744 return
745 out_path = os.path.join(self.output_dir, "xml", path + ".xml")
746 os.makedirs(os.path.dirname(out_path), exist_ok=True)
747 last_xml.write(out_path, encoding="utf-8")
748
749 def on_finish(self) -> None:
750 last_xml = self.memory_xml.last_xml

Callers 1

fileMethod · 0.45

Calls 3

startswithMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected