Skip to content

Formatting can result in mixed line endings #32

@michaelhthomas

Description

@michaelhthomas

In the process of testing this project, I noticed that some files were ending up with a mixture of LF and CRLF line endings. It seems that Roslyn only updates the line endings on lines that are touched in some way, while other lines maintain their original endings. As such, if a file is formatted with LF line endings, and formatted with CRLF as the target, it can end up with mixed endings.

It looks like dotnet format has a dedicated formatter for this specific purpose. I would recommend something similar here as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions