Repository navigation
Add .editorconfig, a CI check that fails on CRLF, and ruff line-endin… - #1495
Merged
Merged
Conversation
…g = lf .editorconfig sets LF, a final newline, trimmed trailing whitespace, and UTF-8 for every file, including the gitignored working files that .gitattributes never sees. The CI workflow now fails when any tracked text file reaches a commit with CRLF or mixed line endings. ruff format writes LF instead of keeping whatever ending a file already had, so the formatter can no longer preserve a CRLF file on Windows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes standardizing LF line endings.
No open issues 🎉
What changed in this PR
This PR standardizes LF line endings across editor settings, Python formatting, and CI in hed-python.
Changes:
- Add repository-wide EditorConfig defaults, including for gitignored working files.
- Add a CI check that rejects tracked CRLF or mixed-line-ending files, excluding files marked
-text. - Configure Ruff to write LF line endings rather than preserve existing endings.
| File | Description |
|---|---|
pyproject.toml |
Set Ruff's formatter to use LF line endings. |
.github/workflows/ci.yaml |
Check committed line endings after checkout. |
.editorconfig |
Set LF, UTF-8, final-newline, and trailing-whitespace defaults. |
Review effort: Balanced
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.
…g = lf
.editorconfig sets LF, a final newline, trimmed trailing whitespace, and UTF-8 for every file, including the gitignored working files that .gitattributes never sees. The CI workflow now fails when any tracked text file reaches a commit with CRLF or mixed line endings. ruff format writes LF instead of keeping whatever ending a file already had, so the formatter can no longer preserve a CRLF file on Windows.