Skip to content

Add LF line ending check to pre-commit#547

Open
schroedtert wants to merge 1 commit into
PedestrianDynamics:mainfrom
schroedtert:pre-commit-lineending
Open

Add LF line ending check to pre-commit#547
schroedtert wants to merge 1 commit into
PedestrianDynamics:mainfrom
schroedtert:pre-commit-lineending

Conversation

@schroedtert

Copy link
Copy Markdown
Collaborator

No description provided.

@schroedtert schroedtert marked this pull request as ready for review June 10, 2026 18:07
Comment thread .pre-commit-config.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@schroedtert schroedtert force-pushed the pre-commit-lineending branch from 9ff5384 to 066f23d Compare July 6, 2026 19:06
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.01%. Comparing base (a227267) to head (066f23d).

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants