dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors on linux but no errors on mac for the same code

justinmchase opened this issue · comments

I am running the same format code on both mac and linux but one particular warning is not recognized on mac but it is reconized on windows.

mac

> dotnet format --version
7.3.426909+88adfff40b5b96258cd91c6ea681b25488ba8606

I am running this command in both places:

dotnet format Optum.ControlPlane.sln \
  --no-restore \
  --severity info \
  --verbosity detailed \
  --verify-no-changes

Here is an abbreviated example of the output:

Warning: /runner/_work/example/example/src/Example/example.cs(120,17): warning IDE0009: Add 'this' or 'Me' qualification [/runner/_work/example/example/src/Example/example.csproj]
  Running 240 analyzers on Example.
  Formatted code file '/runner/_work/example/example/src/Example/example.cs'.
  Formatted 5 of 255 files.
  Format complete in 15118ms.

Whats interesting is that all of these errors are manifesting on object initializers, I can see. For example:

var example = new Example
{
  Name = Name
};

Where Name should be this.Name. The warning is correct, and when I look at the code in VSCode I can see the property reference underlined in yellow, so vscode is also able to correctly identify the issue, but I just can't get the dotnet format command to recognize it or automatically fix them all on a mac.

After updating to donet 7.0.401 the issue was fixed.