-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Remove trailing whitespaces from codebase #12980
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,9 @@ system/ linguist-vendored | |
|
|
||
| AUTHORS merge=union | ||
| ChangeLog.md merge=union | ||
|
|
||
| # line endings | ||
| * text=auto eol=lf | ||
| *.{cmd,[cC][mM][dD]} text eol=crlf | ||
| *.{bat,[bB][aA][tT]} text eol=crlf | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have any files with mixed case extensions like this. I think just adding |
||
| *.{vcxproj,vcxproj.filters} text eol=crlf | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing a newline at EOF. |
||
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.
Just to be clear, this means that for almost all files, developers will see unix line endings, even on windows? Why is that desirable?
Uh oh!
There was an error while loading. Please reload this page.
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.
Any executable file that is supposed to run on Linux must be LF, and any executable that wants to run on Windows must be CRLF.
If someone clones this repository on Windows and then opens it in WSL, the line-endings will break because they become CRLF by default if no option is specified.
So, to fix these issues, one convention should be chosen. The easiest one is to specify CRLF for Windows executables and make everything else LF.
My addition is based on this:
https://rehansaeed.com/gitattributes-best-practices/
I can change the code to be less forceful for consistent line-ending. However, this only covers
.shfiles. It is usually common to use hash bangs for executables and not the file extension, and so those files will become faulty if they are accessed from another operating system.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.
If this is just to support WSL users who are using a kind of hybrid environment I'm not sure it worth it. I would have though that WSL users already have to savy enough to setup global settings.
In any case, can we split out this PR so we can discuss the
.gitattributesseparately. It seems like its worth further discussion and I don't want to block to this PR.