Skip to content

Add .gitattributes to enforce LF line endings#8

Closed
maccoss wants to merge 1 commit into
Noble-Lab:mainfrom
maccoss:chore/normalize-line-endings
Closed

Add .gitattributes to enforce LF line endings#8
maccoss wants to merge 1 commit into
Noble-Lab:mainfrom
maccoss:chore/normalize-line-endings

Conversation

@maccoss

@maccoss maccoss commented Jun 27, 2026

Copy link
Copy Markdown

What

Adds a .gitattributes that normalizes text to LF in the repository (CRLF only for Windows .bat/.cmd; binaries untouched).

Why

The repo had no .gitattributes and core.autocrlf is unset, so Windows checkouts silently rewrote files to CRLF, surfacing the entire tree as modified and otherwise burying real changes under line-ending churn. The repository is already stored as LF, so no existing file contents change — this PR is just the normalization policy.

Notes

Two follow-up PRs are stacked on this one (OspreySharp feature, then installer + CI). Merging this first keeps their diffs clean.

Summary by CodeRabbit

  • Chores
    • Standardized line endings across the repository for text files, helping reduce cross-platform formatting issues.
    • Preserved Windows-style endings for batch scripts and protected binary files from unintended line-ending changes.

The repository is already stored with LF endings, but it had no
.gitattributes and core.autocrlf is unset, so Windows checkouts silently
rewrote files to CRLF and surfaced the entire tree as modified. This adds an
explicit normalization policy (LF in the repo; CRLF only for Windows .bat/.cmd;
binaries untouched) to stop that churn going forward.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 27, 2026 07:26
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds repository-wide .gitattributes rules for LF normalization, CRLF preservation for Windows batch files, and binary handling for common binary extensions.

Changes

Line ending normalization

Layer / File(s) Summary
Repository attribute rules
.gitattributes
Adds text, Windows script, and binary file attributes to control line-ending handling across the repo.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🐇 I hop through bytes and lines,
LF for text and CRLF for signs.
Binaries stay snug, endings stay tight,
.gitattributes makes the burrows right.
Hoppity hop, all neat and bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: adding .gitattributes to enforce LF line endings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a repository-wide Git attributes policy to normalize text files to LF line endings while preserving CRLF for Windows batch scripts and preventing any line-ending conversion for common binary asset types. This helps avoid noisy diffs on Windows checkouts (especially when core.autocrlf isn’t configured) and keeps future PRs focused on real changes.

Changes:

  • Add .gitattributes with * text=auto eol=lf to enforce LF for text files.
  • Add overrides to keep *.bat / *.cmd as CRLF.
  • Mark common binary extensions as binary to avoid any EOL processing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.gitattributes (1)

8-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding more common binary extensions for deterministic handling.

The current binary list is solid for the stated cohort. For broader determinism, you may also want to explicitly mark: .pdf, .so, .dylib, .class, .war, .tar, .bz2, .7z, .rar, .woff, .woff2, .ttf, .mp3, .mp4, .mov, and .avi. This ensures Git never attempts text normalization on them regardless of heuristic misclassification.

Not blocking — text=auto generally handles these correctly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.gitattributes around lines 8 - 19, The binary asset rules in .gitattributes
should be expanded to cover more common formats so Git never normalizes them as
text; update the existing binary list to explicitly include the additional
extensions mentioned in the review, keeping the current pattern style
consistent. Use the .gitattributes binary section as the place to add these
entries so deterministic handling is applied alongside the current markers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.gitattributes:
- Around line 8-19: The binary asset rules in .gitattributes should be expanded
to cover more common formats so Git never normalizes them as text; update the
existing binary list to explicitly include the additional extensions mentioned
in the review, keeping the current pattern style consistent. Use the
.gitattributes binary section as the place to add these entries so deterministic
handling is applied alongside the current markers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6d56fb27-8896-46d6-8891-5be6197db9c0

📥 Commits

Reviewing files that changed from the base of the PR and between 048710b and 62ae155.

📒 Files selected for processing (1)
  • .gitattributes

@maccoss

maccoss commented Jun 28, 2026

Copy link
Copy Markdown
Author

Superseded by #11, which consolidates this work (the finetune and decoy/FDRBench fixes landed only on main, so the scoped branches diverged). Closing in favor of the single consolidated PR.

@maccoss maccoss closed this Jun 28, 2026
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