Add LF line ending check to pre-commit#547
Conversation
There was a problem hiding this comment.
When I cloned the repository and ran the pre-commit checks for the first time, every single file in the repository was modified due to my core.autocrlf settings (as everything was converted to CRLF and then back to LF line endings).
Maybe, as you already changed the .pre-commit-config in this area, it might also be useful to update the .gitattributes file so that settings like this are consistently overridden automatically?
There was a problem hiding this comment.
Good catch, that way would be even better. Added the gitattribute and kept the pre-commit check as second layer
Contributors with core.autocrlf enabled would see every text file as modified on first clone, because Git converted LF→CRLF on checkout and then back on commit. Adding eol=lf to .gitattributes makes LF normalization authoritative at the Git level, overriding local autocrlf settings before any tool runs. The mixed-line-ending pre-commit hook acts as a second layer, catching any files that slip through during development.
9ff5384 to
066f23d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
No description provided.