chore: enforce LF line endings, align Ruff/mypy with pre-commit, and normalize formatting#974
Draft
b-l-u-e wants to merge 3 commits into
Draft
chore: enforce LF line endings, align Ruff/mypy with pre-commit, and normalize formatting#974b-l-u-e wants to merge 3 commits into
b-l-u-e wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #974 +/- ##
==========================================
- Coverage 74.92% 73.78% -1.14%
==========================================
Files 111 112 +1
Lines 12065 12262 +197
==========================================
+ Hits 9040 9048 +8
- Misses 3025 3214 +189 ☔ View full report in Codecov by Sentry. |
b78f424 to
40965ef
Compare
40965ef to
6f1a5f0
Compare
6f1a5f0 to
6537613
Compare
added 3 commits
May 21, 2026 21:45
Add .gitattributes with plus explicit binary marks for the Tor bundle executables, versioned shared libraries (libssl.so.1.1 etc.), and the bundled SQLite database. Previously these relied on Git's content-based auto-detection and would otherwise have inherited from the wildcard rule. Add .editorconfig so editors apply the same LF / final-newline / trim-trailing-whitespace policy on save. Add to the mixed-line-ending pre-commit hook so it no longer falls back to auto behavior. No tool versions or other hook configurations are changed. Signed-off-by: b-l-u-e <8102260+blue@users.noreply.github.com>
`make format` now operates only on files staged in the current commit: after `ruff check --fix` on staged .py files, it runs a small Python one-liner that rewrites CRLF -> LF on staged text files (whitelist of known text extensions, so binaries are never touched). Scoping to staged files keeps focused PRs from accidentally rewriting unrelated files. Whole-tree lint fix is still `make ruff` and full CI parity is still `make pre-commit`.
Signed-off-by: b-l-u-e <8102260+blue@users.noreply.github.com>
6537613 to
2e2c4a6
Compare
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.
This fixes the issue #970
Establish explicit LF line ending policy
Problem
Experiencing noisy whitespace-only diffs when making small changes:
make formatdidn't normalize line endings.pre-commit-config.yamlusedautomode for mixed-line-ending (inconsistent behavior).gitattributesto define repository line ending standardSolution
Establish an explicit LF (Unix-style) line ending policy with enforcement at multiple levels:
Configuration added:
.gitattributes- Git normalizes line endings to LF on commit.editorconfig- Editors default to LF for new files.pre-commit-config.yaml- Explicit--fix=lffor mixed-line-ending hookMakefile- Updatedpre-committarget withSKIP=ruff-formatto match CIFiles normalized:
Impact
✅ Prevents future issues: New files will automatically use LF
✅ Clean PRs: Contributors won't accidentally introduce whitespace noise
✅ CI alignment: Local
make pre-commitnow matches CI behavior✅ No code changes: All modifications are whitespace-only
For Contributors
git config core.autocrlf inputafter cloning (one-time setup)make formatbefore committingBreaking Changes
None. This is purely a whitespace normalization.
Checklist
.gitattributesand.editorconfig.pre-commit-config.yamlwith explicit--fix=lfMakefileto match CI behavior