Skip to content

Line endings on Windows. #258

Closed
Closed

Description

@jaccarmac

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.

Activity

  1. jgirardet commented on May 26, 2018

    @jgirardet
    Contributor

    Not exactly the same thing but it sounds like that.

  2. jaccarmac commented on May 27, 2018

    @jaccarmac
    Author

    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.

  3. kalekseev commented on May 27, 2018

    @kalekseev
    Contributor

    @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.

  4. ambv commented on May 29, 2018

    @ambv
    Collaborator

    Hm. I think what Black should do here is to retain existing line endings. That doesn't require any configuration.

  5. ambv commented on May 29, 2018

    @ambv
    Collaborator

    @zsol, I will assign this to you as you have opportunity to test this on Windows.

  6. kalekseev commented on May 29, 2018

    @kalekseev
    Contributor

    @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.

  7. jdufresne commented on Dec 24, 2018

    @jdufresne
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

T: bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions