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

Method on_file

mypy/report.py:777–794  ·  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

775 self.param_html = etree.XSLT.strparam("html")
776
777 def on_file(
778 self,
779 tree: MypyFile,
780 modules: dict[str, MypyFile],
781 type_map: dict[Expression, Type],
782 options: Options,
783 ) -> None:
784 last_xml = self.memory_xml.last_xml
785 if last_xml is None:
786 return
787 path = os.path.relpath(tree.path)
788 if path.startswith(".."):
789 return
790 out_path = os.path.join(self.output_dir, "html", path + ".html")
791 os.makedirs(os.path.dirname(out_path), exist_ok=True)
792 transformed_html = bytes(self.xslt_html(last_xml, ext=self.param_html))
793 with open(out_path, "wb") as out_file:
794 out_file.write(transformed_html)
795
796 def on_finish(self) -> None:
797 last_xml = self.memory_xml.last_xml

Callers

nothing calls this directly

Calls 4

bytesClass · 0.85
startswithMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected