SonarLint does not apply custom Sonar rules

I have developed a bunch of custom rules and deployed them on a Sonar server. When gitlab applies mvn sonar:sonar, the rules are applied as expected. But when I connect sonarlint to that server, they are not.

I inspected the log and discovered an entry “activeRules” which lists all the rules, starting with “kubernetes:S6431”. This list does not contain any rule identifier of my custom rules. Somehow the rules and its jar repository are not downloaded, I assume.

I use

  • Operating system: Windows 11 Enterprise 22631.3880
  • SonarLint plugin version: 10.7.0.78874
  • IntelliJ version: 2024.1.4 Ultimate
  • Programming language you’re coding in: Java 17
  • Is connected mode used: yes

Hey there!

Have you marked the plugin as compatible with SonarLint in the manifest? From the docs :

Note: Custom rules written in Java will run in SonarLint if SonarLint compatibility is properly notated in the custom plugin manifest, see this example for the syntax.

Yes, I did

In that case I suggest posting the verbose logs from SonarLint when analyzing a file you expect the custom rules to be applied to.

It is obviously due to a bug in SonarQube 10.4 . With 10.6, the rules are downloaded and applied in SonarLint

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.