Repro of files requiring 2 passes of dotnet format to fully format
float3 opened this issue · comments
hill 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
Joey Robichaud commented
Taking a look at the code that didn't fully format on the first pass.
Adding braces did not always anchor correctly.
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.