You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Black outputs CRLF line endings on Windows even if the source file has Unix-style lines. It's possible to work around using for example Git configuration, but it would be nice if the behavior was configurable. Some of us like to keep Unix line endings even on Windows.
Thanks, that's exactly the bug I'm noticing! default_line_ending is a Sublime setting no? So not exactly the right solution but fixing this bug should also fix that one.
@ambv I know that you don't want to support config files and extra options but consider supporting end_of_line and insert_final_newline rules from editorconfig with https://pypi.org/project/EditorConfig/ help.
@ambv there are projects that have a mix of windows and unix line endings even in a single file so if you picked such a project you won't be able to make it consistent with only black run, you will need to run all files through some tool that will convert line endings across the project, it's not hard to do but inconvenient.
Reacted by Jon Dufresne, Georgii Dolzhykov and casret
black brands itself as uncompromising and opinionated. Perhaps it would be simpler to always choose Unix-style line endings for a consistent output. I recently started working on a project with Windows line endings and noticed black had no opinion on them.
Reacted by s3449461, Asbjørn Apeland, Trevin Gandhi, Olivier Dalang, JeroenBos, Georgii Dolzhykov, C.A.M. Gerlach, woctordho, Gabriel Müller, Philipp Niedermayer and 6 more
Activity
jgirardet commentedon May 26, 2018
Not exactly the same thing but it sounds like that.
jaccarmac commentedon May 27, 2018
Thanks, that's exactly the bug I'm noticing!
default_line_endingis a Sublime setting no? So not exactly the right solution but fixing this bug should also fix that one.kalekseev commentedon May 27, 2018
@ambv I know that you don't want to support config files and extra options but consider supporting
end_of_lineandinsert_final_newlinerules from editorconfig with https://pypi.org/project/EditorConfig/ help.ambv commentedon May 29, 2018
Hm. I think what Black should do here is to retain existing line endings. That doesn't require any configuration.
ambv commentedon May 29, 2018
@zsol, I will assign this to you as you have opportunity to test this on Windows.
kalekseev commentedon May 29, 2018
@ambv there are projects that have a mix of windows and unix line endings even in a single file so if you picked such a project you won't be able to make it consistent with only black run, you will need to run all files through some tool that will convert line endings across the project, it's not hard to do but inconvenient.
jdufresne commentedon Dec 24, 2018
black brands itself as uncompromising and opinionated. Perhaps it would be simpler to always choose Unix-style line endings for a consistent output. I recently started working on a project with Windows line endings and noticed black had no opinion on them.