coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.93k stars 386 forks source link

Update samples for easy execution #1523

Closed daveMueller closed 8 months ago

daveMueller commented 10 months ago

I've seen that the examples in Documentation\Examples need code changes before they can be executed. Mainly this is caused by the roslyn-analyzers that changed with editing our EditorConfig file. Here is an example:

PS D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld> dotnet test --collect:"XPlat Code Coverage" --settings runsettings.xml
  Determining projects to restore...
  Restored D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld\XUnitTestProject1\XUnitTestProject1.csproj (in 34
  8 ms).
  1 of 2 projects are up-to-date for restore.
D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld\ClassLibrary1\Class1.cs(1,1): error IDE0073: A source file i
s missing a required header. [D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld\ClassLibrary1\ClassLibrary1.cs
proj]
D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld\ClassLibrary1\Class1.cs(1,1): error IDE0005: Using directive
 is unnecessary. [D:\Repos\coverlet\Documentation\Examples\VSTest\HelloWorld\ClassLibrary1\ClassLibrary1.csproj]
Bertk commented 10 months ago

Please consider another topic as well. Some old source code files are not complaint to current .editorconfig settings.

This can be resolved with dotnet format for all source code files and will improve the PR review activity.