Search code examples
xmlintellij-ideasonarqubesonarlintsonarlint-intellij

SonarLint doesn't show custom rules from local SonarQube server


I've added some XML custom rules for my project. Then I added these rules to my local SonarQube server. When I analyze my project all of the custom rules appear. When I opened my project in Eclipse and connected to my local sonarqube via sonarlint, everything works fine. The problem with intellij. It doesn't show any of rules except the rules that have been there before.

in my pom.xml I flagged this one

<sonarLintSupported>true</sonarLintSupported>

Also I'm informed that sonarlint doesn't support 3rd party plugins, but I don't use any of them. Maybe there is some exceptions for intellij? cause for eclipse those rules appear.

My sonarqube version is 7.7.0.23042 and sonarlint Version for Intellij : 3.4.0.2532 Sonarlint for eclipse 4.1


Solution

  • SonarLint for Eclipse and IntelliJ don't provide the same features. There are many differences. One of them is a list of supported languages:

    +------------+----------------+-----------------+
    |  Language  | SL Eclipse 4.1 | SL IntelliJ 4.0 |
    |------------|----------------|-----------------|
    |    Java    |       Yes      |       Yes       |
    | JavaScript |       Yes      |       Yes       |
    |   Python   |       Yes      |       Yes       |
    |   Kotlin   |       No       |       Yes       |
    |    Ruby    |       No       |       Yes       |
    |    PHP     |       Yes      |       Yes       |
    +------------+----------------+-----------------+
    

    And another is a different level of support of the above languages. In SonarSource Jira you can find this issue: SLCORE-221 Whitelist SonarSource XML analyzer 2.0, and tickets depend on it:

    I think this could be a reason why you see issues in Eclipse, and don't see them in IntelliJ.