(
html_fnam: str, result: BuildResult, modules: dict[str, ModuleIR], mapper: Mapper
)
| 144 | |
| 145 | |
| 146 | def 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 | |
| 166 | def generate_annotations( |
no test coverage detected
searching dependent graphs…