-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fixed line endings setting in .editorconfig #79
base: master
Are you sure you want to change the base?
Conversation
I don't see any issue with changing line endings since there hasn't been issues with builds. |
Again, this doesn't change anything. This just sets the config to what we are already using. |
There is a potential issue. On linux git normalizes line endings to LF, so having editorconfig set to CRLF can cause all line endings to be changed by the IDE. However depending on the git config there might be a similar situation on windows when we set editorconfig to LF. I'm still waiting for @MichalPetryka opinion, however it might be a better idea to change that in repo git config as well or don't set line ending in editorconfig at all, because git should normalize it anyway. |
We've decided that it might be a better idea to force cloning as CRLF in |
Why not just use LF...? |
Visual Studio always uses CRLF and some other Windows tooling does too. |
LF should always work regardless of platform, CRLF will not. And Visual studio doesnt care about your line endings, we use exclusively LF at work and VS has never had any issues with that. |
And CRLF works everywhere too if you use normal tooling. |
By default, I believe git can automatically convert line endings but I'm probably entirely wrong. But what's the point in the first place? |
That conversion is the entire point of this discussion. By default git converts it to LF on Linux and to either LF or CRLF depending on config on Windows. If the IDE uses CRLF and git converts to LF (or vice versa) you end with ton of automatically made changes by the IDE.
There are windows tools that don't support LF. Even notepad (in a slightly older version, still commonly found) is a good example of that. I don't know a tool on linux that doesn't support CRLF (probably because CRLF contains LF, which is the default linux line ending). Even what's happening on my PC is the perfect example. For me git autoconverts line endings to CRLF and when I changed the .editorconfig as you suggested and did a code cleanup in my IDE I ended with every line of code being changed. Just as you did on linux. |
All files in the repo have LF line endings but the editorconfig is set to CR/LF, I fix.