Skip to content

csharpier-ignore comments force CRLF line endings #884

Description

@pingzing

I'm running into an interesting issue with line endings! I have a project configured to use LF line-endings, both at the .editorconfig level, and in CSharpier's csharpierrc config file. That works fine.

However! I have a block of code that I have // csharpier-ignored. When CSharpier hits that line, it replaces the LFs with CRLFs.

I'm running on Windows, and this is CSharpier v0.24.1.

Example:

No //csharpier-ignore:
image

After adding // csharpier-ignore and running dotnet csharpier .:
image

What makes things even more fun is that once this hits CI, it fails the --check check that we do, because I have git's core.autocrlf set to true, which forces all CRLFs to LFs upon pushing it up to the remote. When CSharpier's --check command runs in CI, it detects that it would change these LFs to CRLFs, and fails the build.

I'm not sure what my expected fix is here. Maybe make the newline-inserting that CSharpier (seems to?) do here respect endOfLine?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions