Make Sonarqube with Opencover ignore some C#classes

Asked

Viewed 170 times

1

It is possible to configure Sonarqube with Opencover to ignore some classes of my project . NET?

1 answer

1

Adds the flag -filter the Opencover execution command to delete types belonging to a namespace MyNamespace:

-filter:"+[*]* -[NomeDaAssembly]MyNamespace.*"

I’m not sure, but I think you can also delete specific files in a similar way:

-filter:"+[*]* -[NomeDaAssembly]MyNamespace.MySpecificClass.cs"
  • I don’t call Opencover directly, everything is done by Sonar, according to the sonar-project.properties. Can you put this "filter" command in sonar-project.properties? From the sonar documentation, apparently, you can only delete at the project level...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.