Skip to content

chore: add .gitattributes to normalize line endings#1900

Open
SamErde wants to merge 2 commits into
maester365:mainfrom
SamErde:chore/add-gitattributes
Open

chore: add .gitattributes to normalize line endings#1900
SamErde wants to merge 2 commits into
maester365:mainfrom
SamErde:chore/add-gitattributes

Conversation

@SamErde

@SamErde SamErde commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Adds a repository-level .gitattributes so text files are stored with LF, preventing CRLF files from being committed from Windows and tripping linters (yamllint flagged this twice during review of #1899).

Details

  • * text=auto stores LF in the repository for all detected text files.
  • YAML, shell, JS/TS, JSON, and markdown files are forced to LF in the working tree too, since CI tooling (yamllint, actionlint, prettier) expects Unix endings.
  • PowerShell files (.ps1, .psm1, .psd1, .ps1xml) are stored with LF but keep platform-default working-tree endings so Windows contributors retain a native editing experience.
  • Common binary asset types are marked binary.

Scope note: this PR intentionally does not renormalize existing files (no git add --renormalize), keeping the diff to a single new file. Existing CRLF blobs will be corrected naturally as files are next modified. A follow-up bulk renormalization can be done later if desired.

Follow-up to review feedback on #1899.

Summary by CodeRabbit

  • Chores
    • Added repository-wide line-ending rules to keep text files consistent across platforms.
    • Standardized common source and documentation formats to use LF endings.
    • Marked common binary asset types as non-text, while treating SVG files as text for improved handling.

Enforce LF in the repository for text files (and in the working tree for
YAML, shell, JS/TS, JSON, and markdown) so tools like yamllint no longer
flag CRLF files committed from Windows. PowerShell files keep
platform-default working-tree endings. Existing files are not
renormalized in this change; endings correct as files are touched.

Suggested by CodeRabbit during review of maester365#1899.
Copilot AI review requested due to automatic review settings July 2, 2026 19:39
@SamErde SamErde requested a review from a team as a code owner July 2, 2026 19:39
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d0aa4687-21d4-4e87-8b8f-1d66b3235956

📥 Commits

Reviewing files that changed from the base of the PR and between 7234488 and 22f6b89.

📒 Files selected for processing (1)
  • .gitattributes
🚧 Files skipped from review as they are similar to previous changes (1)
  • .gitattributes

📝 Walkthrough

Walkthrough

A new .gitattributes file adds LF normalization for text files, PowerShell-specific line ending handling, and binary declarations for selected asset formats while keeping SVG as text.

Changes

Gitattributes Configuration

Layer / File(s) Summary
Line ending and binary declarations
.gitattributes
Adds line ending normalization rules for text/source/doc files, PowerShell handling, and binary declarations for images/fonts/archives with SVG marked as text.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding .gitattributes to normalize line endings.
Description check ✅ Passed The PR includes a clear TL;DR, details, and scope note, but it omits the template's Closes # line and checklist items.
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
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-level .gitattributes to normalize line endings, ensuring text files are stored as LF in the repo to prevent CRLF-related CI/linter noise (notably on YAML/tooling-sensitive files), while keeping a Windows-friendly working-tree experience for PowerShell contributors.

Changes:

  • Introduces * text=auto for repo-wide text normalization to LF.
  • Forces LF checkout for common tooling-sensitive text formats (YAML, shell, JS/TS, JSON, Markdown).
  • Marks PowerShell file types as text (repo-normalized) without forcing working-tree EOL, and marks common asset formats as binary.

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

Comment thread .gitattributes Outdated
Comment thread .gitattributes
*.jpeg binary
*.gif binary
*.ico binary
*.svg text
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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