Excluding external .NET/Roslyn info messages from analyzers in PR's

Hello,

We’ve been using SonarCloud for a while, but recently we added a new Nuget package to our .NET project that ships with Roslyn Analyzers. One of these analyzers triggers an ‘info’ message it also captured by Sonar and reported back to our PR’s as a code smell.

The id of the info message is RMG020 from the Mapperly package:

It shows up as follows in our Azure Devops PR’s:

We’ve tried to exclude this via Administation → General Settings → Analysis Scope:

But this info message still shows up in our PR’s despite all these ignore rules.

How to ignore this info message from a Roslyn Analyzer from PR scans?

We don’t want to disable it locally, as it’s still a good info message for developers. It just should not block PR’s as a code smell.

Thank you for your time.

Hi,

Exclusions work a little differently with the SonarScanner for .NET. It looks like you’ll need to add a .editorconfig file.

 
HTH,
Ann

Hi Ann,

I don’t want to disable it locally and also not for specific folders/files. I just want to have it disabled from triggering as a code smell in the whole project, regardless of where it’s from. Are there any ideas for that?

Thank you for your time.

Hi,

Analysis picks up Roslyn issues automatically. As far as I know, this is the only way to keep this from showing up in SonarCloud.

Alternately, you can Accept the issues raised by the rule.

 
Ann