mypy
mypy copied to clipboard
Add direct HTML reporter to replace XSLT-based output (ideia to fix issue #909)
Objective
This PR introduces a new HTML reporter (html-direct) that generates reports directly using Python, without relying on XSLT transformations. This solves the long-standing issue #909 regarding WebKit browsers failing to render file:// XSL-based reports.
What was done
- Created
html_report.pywithMemoryHtmlReporterandHtmlReporterclasses - Generates one HTML per file, plus an index.html summary
- Copies fallback CSS if missing (
mypy-html.css) - Registered reporters via
register_reporter("html-direct", ...)
Usage
Run with:
mypy your_file.py --html-direct-report output_dir/
Diff from mypy_primer, showing the effect of this PR on open source code:
colour (https://github.com/colour-science/colour): 1.05x faster (1770.8s -> 1684.9s in single noisy sample)
antidote (https://github.com/Finistere/antidote): 1.13x slower (57.3s -> 64.8s in single noisy sample)
pandera (https://github.com/pandera-dev/pandera): 1.12x slower (135.5s -> 152.0s in single noisy sample)
discord.py (https://github.com/Rapptz/discord.py): 1.11x slower (269.6s -> 299.1s in single noisy sample)