dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repro of files requiring 2 passes of dotnet format to fully format

float3 opened this issue · comments

commented

here is my repro
https://github.com/float3/dotnet-format-repro

there are 2 cs files here that take two passes to fully format.

repro steps:

git clone git@github.com:float3/dotnet-format-repro.git
cd dotnet-format-repro
dotnet format *.sln
git add -A
dotnet format *.sln
git status

Taking a look at the code that didn't fully format on the first pass.

Adding braces did not always anchor correctly.

first format:
image

second format:
image

This if statement did not get moved to a newline in the first pass, possibly because it is a single line. However, it became multi line when braces were added and is moved in the second pass.

first format:
image

second format:
image