-
Notifications
You must be signed in to change notification settings - Fork 964
Add .gitattributes to enforce LF line endings #3556
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
base: main
Are you sure you want to change the base?
Add .gitattributes to enforce LF line endings #3556
Conversation
Fixes chaoss#3545 Signed-off-by: Sukuna0007Abhi <[email protected]>
| *.exe binary | ||
| *.dll binary | ||
| *.so binary | ||
| *.dylib binary | ||
| *.pyc binary | ||
| *.pyo binary | ||
| *.pyd binary | ||
| *.whl binary | ||
| *.egg binary |
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.
a lot of these (from .exe down) are unlikely to be in the repo since many of them are compiled program outputs and wouldnt be checked into git
| # Binary files - ensure they're not modified | ||
| *.png binary | ||
| *.jpg binary |
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.
does the automatic behavior account for this already? whats the default behavior?
| *.html text eol=lf | ||
| *.htm text eol=lf | ||
| *.css text eol=lf | ||
| *.scss text eol=lf | ||
| *.js text eol=lf | ||
| *.jsx text eol=lf | ||
| *.ts text eol=lf | ||
| *.tsx text eol=lf | ||
| *.vue text eol=lf |
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.
do we need to specify every single file type like this given that we assume things are ttext files in the first line?
|
@Sukuna0007Abhi There are a couple of other PRs targeting the same issue (#3561, #3562). Could you all please discuss the best way forward and come up with just one PR and close the rest? You can discuss the optimal way forward in the linked issue #3545. |
Fixes #3545
Summary
This PR adds a .gitattributes file to the repository to prevent Windows CRLF line ending issues that can break Python scripts and shell script entrypoints.
Changes
Testing
The .gitattributes file follows GitHub's recommended format for handling line endings. This will prevent Git from automatically converting LF to CRLF on Windows systems, which has been causing issues in WSL and other Windows-based environments.
Related Issues
Resolves #3545
Pls review @sgoggins @MoralCode @cdolfi