-
Notifications
You must be signed in to change notification settings - Fork 796
Force LF line endings #9349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force LF line endings #9349
Conversation
WalkthroughA Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.gitattributes (1)
2-2: Consider more granular.gitattributesrules for better control.Applying
text=auto eol=lfto all files via the wildcard*is overly broad. While this addresses the stated goal of normalizing line endings, a more targeted approach allows finer control over different file types. For example:
- Shell scripts and other text files that require LF
- Windows-specific files (
.bat,.cmd) that may need CRLF- Binary files that should not be normalized
- Generated or vendored files that may have specific requirements
Consider structuring the rules more granularly (e.g.,
*.sh text eol=lf,*.bat text eol=crlf, etc.) to avoid unintended side effects.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.gitattributes(1 hunks)
🔇 Additional comments (1)
.gitattributes (1)
2-2: Verify the wildcard rule won't cause issues with platform-specific or generated files.The blanket
text=auto eol=lffor all files could unexpectedly normalize line endings in files that require platform-specific behavior (e.g., Windows batch files) or generated artifacts. Verify that this configuration aligns with the project's expectations across all file types and platforms.
Depending on how git is configured on Windows, git may attempt to normalize text file line endings to CRLF (\r\n), which results in broken Docker containers being built
|
Oops, a bad rebase when using a shallow clone 🤦♂️ |
Depending on how git is configured on Windows, git may attempt to normalize text file line endings to CRLF (/r/n), which results in broken Docker containers being built, as, for example, the entry point shell script fails to execute.
This PR adds the
.gitattributesfile instructing git to force LF (/n) line endings on text files.Summary by CodeRabbit