Intellij version: 2021.2.2 Ultimate Edition
SonarLint plugin: 5.3.0.36775
SonarQube version: Community Edition Version 9.0.1 (build 46107)
Hi,
in SonarQube we have defined a custom Java Quality Profile which we set as default for Java projects.
We would like to use the rules from this profile in our Intellij using the SonarLint plugin. We have bound SonarLint with the correct Project and SonarQube server, but when we click on update binding we just get the default SonarWay Quality Profile rules imported.
Is there a way to explicitly tell SonarLint to use our custom Quality Profile?
Thanks for letting us know about the problem and welcome to the community!
Unfortunately, I can not reproduce the issue. Once you configured the connection and created binding to the project SonarLint should pick up active Quality Profile from server it’s connected to and apply all rules settings.
To be on the same page I’ll add pictures of how it looks like on my box.
New quality profile with only one active rule is set to default on SonarQube:
If you spotted some difference between your actions and what you see on pictures - that’s may be the reason of the problem. If what I posted above doesn’t help - please answer below and we will continue troubleshooting. Maybe it will be useful to mention exact rules and your expectations about them (you want them to be enabled or disabled by new quality profile).
thank you for the clear answer. We tried something similar and could confirm that SonarLint uses the default Quality Profile from the Project we connected to. However, we noticed that SonarLint doesn’t show all the warnings that we see in SonarQube. In the following screenshots you can see that in SonarQube we have 11 notifications from five different rules, while IntelliJ shows only six notifications from four rules.
Hello @Timon.
Sorry answer took so long.
Short answer - yes, this is expected. Some rules are executed only on remote or server, and some rules are executed only locally on :sonarlint:.
Now long answer. Usually you can rely on this rule reference site: https://rules.sonarsource.com.
In the lower part of the description of each rule you can see icons of the products where this rule is available.
But there are six unfortunate exclusions from this rule. They only executed on SonarQube or SonarCloud server side and not available in SonarLint. But for historical reasons they are not included in that rule reference site I’ve linked above.
So here the list of this rules: