Open Arthri opened 2 years ago
This is pretty bad. Our dotnet format --verify-no-changes
had started silently passing the the CI run even though there were changes. It was printing
Required references did not load for ...
but still had exit code 1
Update: this is still an issue on .NET SDK 8.0.204
I do not know of any other way to trigger this. Hence, I will demonstrate with Paket and missing references.
Reproduction
dotnet tool restore
dotnet paket restore
. Pretend this is a mistakedotnet format MissingRef.sln
. The command fails(output is below) to format anything, but returns a zero exit code indicating it succeeded. Therefore the mistake from earlier was not caught and this will lead to CI checks succeeding despite format errors.Reproduction Full
dotnet paket init
Microsoft.Extensions.DependencyInjection
to Paket, this can be done by adding "Microsoft.Extensions.DependencyInjection
" into paket.references and "nuget Microsoft.Extensions.DependencyInjection
" paket.dependencies.dotnet paket install
.paket
. Simulate a mistakedotnet format [PROJECT].sln
Output
Diagnostic Output
Both outputs, despite failing to load then format the project, returned an unexpected zero exit code. I noticed this on a CI where it would continue "succeed" despite my local copy telling me there's format errors.