Skip to content

refactor: extract report HTML template to a package data file#22

Merged
druvus merged 1 commit into
mainfrom
extract-report-template
Jun 23, 2026
Merged

refactor: extract report HTML template to a package data file#22
druvus merged 1 commit into
mainfrom
extract-report-template

Conversation

@druvus

@druvus druvus commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 awkward to edit as HTML.

Change

  • Moved it to 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.
  • Packaged the template (package-data + 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).
  • Module-size ratchet lowered 2200 → 1300.

Verification

  • 171 report tests pass — render is identical (the .format() mechanism is preserved).
  • Built wheel includes the template; the installed package loads + renders it (25,233 chars).
  • Clean-state full suite 2219 passed, 0 failed, coverage 58.22%.

🤖 Generated with Claude Code

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>
@druvus druvus merged commit 7bf7623 into main Jun 23, 2026
8 checks passed
@druvus druvus deleted the extract-report-template branch June 23, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant