refactor: extract report HTML template to a package data file#22
Merged
Conversation
technical_report.py held a ~894-line inline TECHNICAL_REPORT_TEMPLATE string (str.format placeholders) -- the bulk of the 2100-LOC module, un-lintable and hard to edit as HTML. Move it to neoswga/core/report/templates/technical_report.html and load it via a cached _load_report_template() (importlib.resources, works in dev + installed wheel). render_technical_report() is otherwise unchanged. - technical_report.py: 2100 -> 1220 LOC; the template is now editable/lintable as a real .html file. - Package the template: package-data + MANIFEST entry for neoswga.core.report/templates/*.html; the CI wheel import-smoke now also asserts the template ships (it is a runtime-required data file). - Verified: 171 report tests pass (render identical); wheel build includes the template and the installed package loads + renders it (25,233 chars). Module- size ratchet lowered 2200 -> 1300. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
technical_report.pyheld a ~894-line inlineTECHNICAL_REPORT_TEMPLATEstring (str.format placeholders) — the bulk of the 2100-LOC module, un-lintable and awkward to edit as HTML.Change
neoswga/core/report/templates/technical_report.html(a real, editable/lintable HTML file), loaded via a cached_load_report_template()(importlib.resources— works in dev and installed wheels).render_technical_report()is otherwise unchanged.technical_report.py: 2100 → 1220 LOC.MANIFEST.in); the CI wheel import-smoke now also asserts the template ships (it's a runtime-required data file, same guard the model/checksums got).Verification
.format()mechanism is preserved).🤖 Generated with Claude Code