Skip to content

ci(prek): enforce LF line endings, not just consistent ones - #1568

Merged
potiuk merged 1 commit into
mainfrom
ci/mixed-line-ending-lf
Oct 9, 2026
Merged

potiuk merged 1 commit into
mainfrom
ci/mixed-line-ending-lf

Conversation

@potiuk

@potiuk potiuk commented Oct 9, 2026

Copy link
Copy Markdown
Member

Summary

  • 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.
  • That is what happened on perf(mentoring): trim always-on routing metadata of the family's skills #1563: a commit changing three measured_tokens values rewrote all three SKILL.md files as CRLF, so the PR showed +954/−962 for a +24/−32 change, with CI green.
  • --fix=lf converts 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

  • CI / dev loop (prek, workflows, validators)

Test plan

  • prek run --all-files passes (no file in the tree uses CRLF today — git ls-files --eol lists none — so the main run is unaffected)
  • Other: a probe file written entirely as CRLF (printf 'a\r\nb\r\n') passes under the old config; with this change the hook fails with files were modified by this hook and the file is left with 0 CR bytes

RFC-AI-0004 compliance

No principle touched — dev-loop hook configuration only.

Linked issues

Refs #1563

Notes for reviewers (optional)

.gitattributes with * text eol=lf would 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-denied exclude.


Generative AI disclosure: drafted with Claude Code (Claude Opus 5); reviewed and verified by the author.

🤖 Generated with Claude Code

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
@potiuk potiuk added the family:ci .github workflows, prek, validators label Oct 9, 2026
@potiuk
potiuk merged commit af3859d into main Oct 9, 2026
11 checks passed
@potiuk
potiuk deleted the ci/mixed-line-ending-lf branch October 9, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

family:ci .github workflows, prek, validators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant