How to globally exclude roslyn issues

I’ve been trying to figure out how we can exclude Roslyn issues globally but the only solution I’ve been able to find is to use the .editorconfig file to exclude them. Problem with that is, as far is I understand, this would have to be added per project. This also means everyone would be able to update this file, which I also don’t want.

We have a lot of projects and I’d like all of them to use the same rules.

I’ve tried adding the issues to the global sonarqube settings (Administration → Configuration → General settings → Analysis Scope) like this


but it looks like that’s completely ignored.
I’ve also tried to add it on a specific project, just to test if the feature works at all for roslyn, but that seems to be completely ignored too.

Any suggestions on how I can best achieve my goal?

We’re using:

  • SonarQube Developer edition deployed on k8s

Hi,

Welcome to the community!

The exclusions you’re setting are meant for native rules.

There is a way to do this, but unfortunately you’ll have to do it project-by-project in the analysis configuration.

 
HTH,
Ann

Is there no workaround to get this into 1 file or something? Because the biggest problem with this is keeping them all in sync.

Hi,

As I said, you’ll have to do it project-by-project.

 
Ann

If I understand correctly, the page you linked only shows an option to ignore all roslyn issues or to categorize specific issues. I want to only exclude specific roslyn issues.
Am I misunderstanding this?

Hi,

No, you understand correctly. When you said you wanted to exclude them “globally” this is what I thought you meant.

If you want to pick and choose, then you’ll have to keep the rules from running at all. This SO answer shows how to do that.

 
HTH,
Ann