Repository navigation
ci(prek): enforce LF line endings, not just consistent ones - #1568
Merged
Merged
Conversation
The mixed-line-ending hook ran with its default --fix=auto, which only fails a file that mixes LF and CRLF. A file converted wholesale to CRLF (an editor on Windows, core.autocrlf=true) passed every check and landed as a whole-file rewrite, as on #1563, where a three-number change showed up as +954/-962. --fix=lf converts any CRLF to LF and fails the run, so such a change is caught locally and in CI. No file in the tree uses CRLF today, so the whole-tree run on main is unaffected. Generated-by: Claude Opus 5
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.
Summary
mixed-line-endinghook ran with its default--fix=auto, which only fails a file that mixes LF and CRLF. A file converted wholesale to CRLF (an editor on Windows,core.autocrlf=true) passed every check and landed as a whole-file rewrite.measured_tokensvalues rewrote all threeSKILL.mdfiles as CRLF, so the PR showed +954/−962 for a +24/−32 change, with CI green.--fix=lfconverts any CRLF to LF and fails the run, so the change is caught at commit time and in CI. The hook name now says what it enforces.Type of change
prek, workflows, validators)Test plan
prek run --all-filespasses (no file in the tree uses CRLF today —git ls-files --eollists none — so themainrun is unaffected)printf 'a\r\nb\r\n') passes under the old config; with this change the hook fails withfiles were modified by this hookand the file is left with 0 CR bytesRFC-AI-0004 compliance
No principle touched — dev-loop hook configuration only.
Linked issues
Refs #1563
Notes for reviewers (optional)
.gitattributeswith* text eol=lfwould be the other way to do this, but it normalises on checkout and add rather than failing a check. The hook keeps the enforcement in the same place as the other whitespace hooks and keeps the existing sandbox-write-deniedexclude.Generative AI disclosure: drafted with Claude Code (Claude Opus 5); reviewed and verified by the author.
🤖 Generated with Claude Code