MCPcopy
hub / github.com/python/mypy / generate_annotated_html

Function generate_annotated_html

mypyc/annotate.py:146–163  ·  view source on GitHub ↗
(
    html_fnam: str, result: BuildResult, modules: dict[str, ModuleIR], mapper: Mapper
)

Source from the content-addressed store, hash-verified

144
145
146def generate_annotated_html(
147 html_fnam: str, result: BuildResult, modules: dict[str, ModuleIR], mapper: Mapper
148) -> None:
149 annotations = []
150 for mod, mod_ir in modules.items():
151 path = result.graph[mod].path
152 tree = result.graph[mod].tree
153 assert tree is not None
154 annotations.append(
155 generate_annotations(path or "<source>", tree, mod_ir, result.types, mapper)
156 )
157 html = generate_html_report(annotations)
158 with open(html_fnam, "w") as f:
159 f.write(html)
160
161 formatter = FancyFormatter(sys.stdout, sys.stderr, False)
162 formatted = formatter.style(os.path.abspath(html_fnam), "none", underline=True, bold=True)
163 print(f"\nWrote {formatted} -- open in browser to view\n")
164
165
166def generate_annotations(

Callers 1

generate_cFunction · 0.90

Calls 8

styleMethod · 0.95
FancyFormatterClass · 0.90
generate_annotationsFunction · 0.85
generate_html_reportFunction · 0.85
printFunction · 0.85
appendMethod · 0.80
itemsMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…