Skip to content

chore: prune AI-filler comments and tighten functional style#29

Merged
frederikbeimgraben merged 1 commit into
mainfrom
chore/comment-functional-cleanup
Jun 4, 2026
Merged

chore: prune AI-filler comments and tighten functional style#29
frederikbeimgraben merged 1 commit into
mainfrom
chore/comment-functional-cleanup

Conversation

@frederikbeimgraben
Copy link
Copy Markdown
Owner

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 rendered docstrings that merely restate the TeX/Package protocol docs.

Kept verbatim (genuine "why"): SELinux :z font-mount caveats, seccomp/cap-drop/namespace rationale, XeTeX/glyph and LaTeX-package-behavior explanations, the FillFill_len registry-collision note, the 3.14 # pyright: ignore[reportUnreachable] hint, license/module headers, and all pragmas. A few re.split split-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.tex
  • pytex_api._security.extract_packages
  • pytex_api._sandbox._existing_font_mounts
  • pytex_builder.variants._data_lines
  • pytex_hsrtreport.titlepage._data_table_body
  • pytex_markdown.protocol.convert._signature_callout

Loops 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 baseline
  • basedpyright src: 0 errors, 0 warnings, 0 notes
  • ruff format --check src tests + ruff check src tests: clean

🤖 Generated with Claude Code

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>
@frederikbeimgraben frederikbeimgraben merged commit 1980678 into main Jun 4, 2026
1 check passed
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