How to suppress with SonarQube and SonarLint

We have the latest SonarQube and SonarLint installed. My question is what is the optimal way to suppress issues we don’t care about?

  • Do we use the global suppression files that SonarLint generates? If so, can those suppression files be uploaded to the SonarQube server?

  • Is there a way to have one single global suppression file for SonarLint? We noticed it creates a suppression file in every directory. We tend to move files around and have a lot of directories. It would be nice to have one single truly global file.

  • If we mark something as fixed in the SonarQube web interface, is there a way to pass on that info to SonarLint so that a user does not see intellisense complaining about suppressed issues? Do we need to suppress issues in both SonarQube and SonarLint?

Do we use the global suppression files that SonarLint generates? If so, can those suppression files be uploaded to the SonarQube server?

I don’t understand what you mean. SonarLint creates local caches and other internal work files during its operations, but none of those are meant for the end user. I don’t know what are “suppression files”.

Is there a way to have one single global suppression file for SonarLint? We noticed it creates a suppression file in every directory.

What file is that? Please clarify.

If we mark something as fixed in the SonarQube web interface, is there a way to pass on that info to SonarLint so that a user does not see intellisense complaining about suppressed issues?

Absolutely! You can configure SonarLint to connect to a project in SonarQube. Not only SonarLint will hide the issues you marked resolved on the server, it will use the same rules configured in the quality profile of the project, and also the configured file exclusion patterns.

I hope this helps, cheers,
Janos

2 Likes

What file is that? Please clarify.
-> When filtering a file in VisualStudio with SonarLint it creates a file GlobalSuppressions.cs