chore: prune AI-filler comments and tighten functional style#29
Merged
Conversation
Whole-repo cleanup pass over src/. Two goals, behavior strictly unchanged (golden-file suite + full pytest stay green). Comments: drop comments that only paraphrase the code or narrate a genexp, and two redundant `rendered` docstrings that just restate the TeX/Package protocol docs. Real "why" rationale kept verbatim — SELinux `:z` font-mount caveats, seccomp/namespace notes, XeTeX/glyph and LaTeX-package explanations, the Fill registry-collision note, license headers and all pragmas. A few split-mechanics comments were folded into the adjacent docstring rather than deleted. Functional style: rewrite leftover empty-list/append/join accumulators into comprehensions / generator expressions where it stays readable (template.tex, extract_packages, _existing_font_mounts, _data_lines, _data_table_body, _signature_callout). Loops with side effects, early breaks, or positional branching were left as loops. 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.
Whole-repo cleanup pass over
src/. Two goals, behavior strictly unchanged — the golden-file regression suite (#28) plus the full pytest suite stay green, exactly so this pass can't introduce a silent output regression.Goal A — drop AI-filler comments
Removed comments that only paraphrase the code or narrate a genexp, plus two redundant
rendereddocstrings that merely restate theTeX/Packageprotocol docs.Kept verbatim (genuine "why"): SELinux
:zfont-mount caveats, seccomp/cap-drop/namespace rationale, XeTeX/glyph and LaTeX-package-behavior explanations, theFill→Fill_lenregistry-collision note, the 3.14# pyright: ignore[reportUnreachable]hint, license/module headers, and all pragmas. A fewre.splitsplit-mechanics comments were folded into the adjacent docstring rather than deleted.Goal B — functional style
Rewrote leftover empty-list/append/join accumulators into comprehensions / generator expressions where it stays readable, matching the existing genexp idiom:
pytex.template.texpytex_api._security.extract_packagespytex_api._sandbox._existing_font_mountspytex_builder.variants._data_linespytex_hsrtreport.titlepage._data_table_bodypytex_markdown.protocol.convert._signature_calloutLoops with side effects, early breaks, or positional-arg branching were deliberately left as loops.
Scope
11 files changed, +51/−56. The repo was already well-curated (recent 1.0 API freeze + golden snapshots), so most packages needed no change.
Verification
pytest(incl.tests/golden): 911 passed, 4 skipped — identical to baselinebasedpyright src: 0 errors, 0 warnings, 0 notesruff format --check src tests+ruff check src tests: clean🤖 Generated with Claude Code