chore: add .gitattributes to normalize line endings#1900
Conversation
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.
Up to standards ✅🟢 Issues
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA new ChangesGitattributes Configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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=autofor 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.
| *.jpeg binary | ||
| *.gif binary | ||
| *.ico binary | ||
| *.svg text |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
TL;DR
Adds a repository-level
.gitattributesso 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=autostores LF in the repository for all detected text files..ps1,.psm1,.psd1,.ps1xml) are stored with LF but keep platform-default working-tree endings so Windows contributors retain a native editing experience.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