dotnet / format

Home for the dotnet-format command
MIT License
1.94k stars 172 forks source link

Support format via NormalizeWhitespace #1502

Open sharwell opened 2 years ago

sharwell commented 2 years ago

I'm interested in calling NormalizeWhitespace on all C# and VB source files in a folder as a processing tool between git difftool and opening up two source trees in Beyond Compare. One scenario that would benefit from this is reviewing semantic changes in this view: https://github.com/icsharpcode/ILSpy/compare/4b865c27...3c6961a9. By calling NormalizeWhitespace on the left and right trees of the comparison, all insignificant whitespace differences (including those that span multiple lines) would be ignored by the diff tool.

I propose adding the option --normalize for this feature.

JoeRobich commented 2 years ago

I could see this option being added to the whitespace subcommand. When this option is set, we would ignore all whitespace formatters except for invoking NormalizeWhitespace.