You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/10/09 08:07:45 UTC

[PR] ci(prek): enforce LF line endings, not just consistent ones [magpie]

potiuk opened a new pull request, #1568:
URL: https://github.com/apache/magpie/pull/1568

   ## 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 #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
   
   - [x] CI / dev loop (`prek`, workflows, validators)
   
   ## Test plan
   
   - [x] `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)
   - [x] 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](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] ci(prek): enforce LF line endings, not just consistent ones [magpie]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1568:
URL: https://github.com/apache/magpie/pull/1568


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org