Skip to content

Strip trailing whitespace from generated pages at write time - #125

Merged
HodlDee merged 2 commits into
mainfrom
fix-trailing-whitespace
Sep 8, 2026
Merged

HodlDee merged 2 commits into
mainfrom
fix-trailing-whitespace

Conversation

@HodlDee

@HodlDee HodlDee commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Review round three. I claimed a rebuild would clear the whitespace-only lines git diff --check flags in docs/guides.html. It does not — they are not stale output. Template literals indent their blank lines along with everything else, so the generator emits them every time. 329 lines across the site.

Harmless to a browser; not harmless to review, since any change shifting those lines puts git diff --check noise in front of the next reviewer.

tidy() strips them at the two write points. 329 → 6, and the six are deliberate: entropy-offline.html and the entropy.html page built from the same Workshop source are both left alone. That artifact's bytes are published as a SHA-256 and signed by the attestations verified last round, and "harmless formatting" is exactly the class of change that must not reach a file whose exact bytes are a published claim.

Digest unchanged: 61f8ed3babf359618961254c4ae9eb6fff18c33033b7dd2d9afe4def86d39987.

git diff -w on the generated tree is empty, so all 323 changed lines are whitespace only, and a second build produces no further change.

🤖 Generated with Claude Code

Follow-up review round three: "the combined rebuild still produces three
whitespace-only lines flagged by `git diff --check` in `docs/guides.html`.
Rebuilding alone does not remove them as the response anticipated. Fix the
generating template if cleaning them up."

Correct on both counts. I said a rebuild would clear them and it does not,
because they are not stale output. Template literals indent their blank lines
along with everything else, so the generator emits them every time. The site
carried 329 such lines.

Harmless to a browser. Not harmless to review: `git diff --check` flags each one
as it enters a diff, so any change that shifts those lines puts noise in front
of the next reviewer.

`tidy()` strips trailing spaces and tabs at the two points where site pages and
guide pages are written. 329 lines to 6, and the remaining six are deliberate.

## What is deliberately not tidied

`docs/entropy-offline.html` keeps its three, and so does the `docs/entropy.html`
page built from the same Workshop source.

The artifact's bytes are published as a SHA-256 and signed by build attestations
that the reviewer verified in the last round. "Harmless formatting" is precisely
the class of change that must not reach a file whose exact bytes are a published
claim, and the site page is kept byte-identical to it for the same reason the
Workshop guard checks the two together.

The digest is unchanged: `61f8ed3babf359618961254c4ae9eb6fff18c33033b7dd2d9afe4def86d39987`.

## Verification

`git diff -w` against the generated tree is empty, so every one of the 323
changed lines is whitespace only. A second build produces no further change, so
the output is still reproducible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@HodlDee
HodlDee merged commit d6a448b into main Sep 8, 2026
14 checks passed
@HodlDee
HodlDee deleted the fix-trailing-whitespace branch September 8, 2026 05:28
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