Skip to content

Leave files when changes cannot be merged #1574

Description

@madelson

When I run dotnet-format/dotnet format on large projects, some files will be left in a non-building state with a comment like:

/* Unmerged change from project 'ProjectName(netstandard2.0)'
Before:
...
/* existing c-style comment */

In my case, there is another C-style comment within the commented-out block which terminates the "outer" comment and results in invalid syntax.

If the formatter can't handle a file for whatever reason, I'd much rather it leave that file unchanged (perhaps printing an error to stdout) instead of leaving artifacts like this in it. That behavior is frustrating regardless, but especially so if it breaks the build as in the case described above.

I'm running dotnet-format My.sln --diagnostics=IDE0161

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions