chore: one line ending for the repository (.gitattributes + renormalize + enforcing test) - #38
Merged
xtimmy86x merged 1 commit intoSep 16, 2026
Conversation
GreenGrassBlueOcean
marked this pull request as draft
September 16, 2026 13:06
GreenGrassBlueOcean
force-pushed
the
chore/normalize-line-endings
branch
from
September 16, 2026 14:02
8034c59 to
6c47364
Compare
GreenGrassBlueOcean
marked this pull request as ready for review
September 16, 2026 14:02
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
xtimmy86x
previously approved these changes
Sep 16, 2026
GreenGrassBlueOcean
dismissed
xtimmy86x’s stale review
September 16, 2026 16:09
The merge-base changed after approval.
Contributor
|
@GreenGrassBlueOcean you have to update to latest master for approval |
…e, test) master stored five files with CRLF - .gitignore, LICENSE, __main__.py, connection.py, message.py - next to an LF majority, and connection.py mixed the two within the file. Any edit from a differently configured editor then rewrote the whole file: OpenWebNet-HA#35 rendered as +248/-218 for a +38/-8 change, OpenWebNet-HA#36 as +691/-615 for +324/-248, and a reviewer passed on both for that reason. `* text=auto eol=lf`, `git add --renormalize .`, and tests/test_line_endings.py so a CR that bypasses the clean filter fails the suite instead of the next reviewer. That test found one such path straight away: validate_corpus.py rewrote tests/golden/corpus.json with the platform newline on every run, so any Windows checkout that ran the suite had a CRLF corpus.json waiting to be committed. It now writes LF. Every byte other than line endings is unchanged: `git diff --ignore-cr-at-eol` shows only the two new files and the one-line newline argument. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
GreenGrassBlueOcean
force-pushed
the
chore/normalize-line-endings
branch
from
September 16, 2026 16:21
6c47364 to
a89badb
Compare
Contributor
Author
|
I have rebased the PR on the latest master. It should be good to go! |
xtimmy86x
approved these changes
Sep 16, 2026
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.
Why
masterstores five files with CRLF —.gitignore,LICENSE,OWNd/__main__.py,connection.py,message.py— next to an LF majority, andconnection.pyis mixed within the file. Any edit from a differently configured editor rewrites the whole file: #35 rendered as +248/−218 for a +38/−8 change and #36 as +691/−615 for +324/−248, and a reviewer passed on both for that reason. #35 flattenedconnection.pyto CRLF, #36 flatteneddiscovery.pyto LF — each PR picked a different answer because the repo never gave one.What — one commit,
6c47364.gitattributes:* text=auto eol=lf; CRLF kept for*.bat/*.cmd/*.ps1; binaries listed.git add --renormalize .— the five files, line endings only.git diff --ignore-cr-at-eolagainst its parent shows nothing but the two new files and one line invalidate_corpus.py.tests/test_line_endings.py— fails the suite if any tracked text file contains a CR, so a file that bypasses the clean filter is caught by CI, not by the next reviewer.tools/golden/validate_corpus.pyrewrotetests/golden/corpus.jsonwith the platform newline on every suite run, so every Windows checkout that ran the tests had a CRLFcorpus.jsonsitting in its working tree ready to be committed. It now writesnewline="\n".632 tests (631 + the new one), ruff clean,
mypy --strictclean. Run twice in a row on Windows: the tree stays clean.Merge order — either works
This branch is
master+ the four commits of #39 + this one, so:Nothing else needs to rebase either way. Any branch opened before this lands picks it up with
git -c merge.renormalize=true rebase master— the three-way merge then compares normalised content and the line-ending change never conflicts with real edits.🤖 Generated with Claude Code