build(hooks): push docs changes from a Windows checkout - #147
Conversation
The rules audit parses frontmatter with `/^---\n/`. On a Windows checkout with `core.autocrlf=true` the working tree holds CRLF while the committed content is LF, so the pattern stops matching, every rule reports as missing frontmatter, and the pre-push hook refuses the push on valid files. Pin the checkout to LF with `.gitattributes` so the working tree matches what is committed, and strip CR at read time in check-rules.mjs so the audit stays correct on clones made before `.gitattributes` landed.
Time Submission Status
Submit or update total time with: Add time on top of previous submission with: See available commands to help comply with our Guidelines. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe repository now enforces LF line endings and binary file handling. The rules validation script normalizes CRLF input to LF for configuration, rule, index, document, and README reads. ChangesLine Ending Normalization
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@holdex pr add-time 11m |
The rules audit parses frontmatter with
/^---\n/. On a Windows checkout withcore.autocrlf=true, the Windows default, the working tree holds CRLF while the committed content is LF. The pattern stops matching, every rule reports as missing frontmatter, and the pre-push hook refuses the push on files that are perfectly valid.The reported case was
holdex/partnerships, but this repo ships the samescripts/check-rules.mjsand carries the identical exposure.What changed
.gitattributespins the checkout to LF, so the working tree stays byte-identical to what is committed on every platform. This removes the root cause.check-rules.mjsstrips CR at read time via areadFileSyncwrapper, which covers all seven read sites at once rather than patching each pattern. This keeps the audit correct on clones made before.gitattributeslanded, which.gitattributesalone does not fix until a contributor re-normalizes.Verification
Converting
docs/**/*.mdto CRLF in a scratch copy reproduces the reported failure exactly: the audit fails with 98 issues, every rule reported as missing frontmatter. With the script change in place the same CRLF tree passes. The normal LF tree passes before and after (35 rules, no issues).For the reviewer
The Problem left the approach open between normalizing line endings and making the scripts agnostic. This does both, because they fix different halves:
.gitattributesprevents it for new clones, the script change unblocks existing ones.marketing-websitewas raised as unverified in the Problem and is not affected. Itsscripts/lint-content-tags.mjsalready matches/^---\r?\n([\s\S]*?)\r?\n---/, and the rest of its hook does not depend on working-tree line endings.holdex/partnershipsstill needs the same two changes to unblock the original reporter. That is a separate PR in that repo.Summary by CodeRabbit