-
Notifications
You must be signed in to change notification settings - Fork 503
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
ktlint format saves file with Unix line endings on Windows #225
Comments
We check in So unfortunately, the support you mention does not address the underlying issue. |
I'm not sure I understand.
If you have developers working on the same code both on Linux and Windows, using native line endings doesn't sound like a good idea (polluted git diffs, etc.) (unless you have a proper .gitattributes). |
But that's the problem. I want ktlint to use the native line endings of the platform it's running on. Otherwise when I run ktlint format, for one platform, the line endings of files will be changed. As I said in my original description, I think ktlint should either (A) be configurable to use "platform native line endings", or (B) configurable to respect the existing line endings in the file when it's formatting it.
I'm not sure I follow you. Windows users typically have In fact, what ends up happening when ktlint runs for me (on Windows) is that all my files are CRLF, except the ones that ktlint formats touched, which are LF, and that leaves me with that confusing diff state to which you refer. |
Alright, I'm reopening the ticket as there seems to be an issue with CRLF not being preserved on Windows (case B) (even though it should work). For case A I'm going to add
|
|
I would expect either (A) the existing line endings to be preserved, or (B) the platform's native line endings to be used.
The text was updated successfully, but these errors were encountered: