Strip trailing whitespace from generated pages at write time - #125
Merged
Merged
Conversation
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>
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.
Review round three. I claimed a rebuild would clear the whitespace-only lines
git diff --checkflags indocs/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 --checknoise in front of the next reviewer.tidy()strips them at the two write points. 329 → 6, and the six are deliberate:entropy-offline.htmland theentropy.htmlpage 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 -won 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