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
Can you open the SonarLint logs tab, enable verbose output, and run again the binding update. It should display the list of plugins that have been downloaded from the server. Please share the entire log if you don’t know where to look at.
I see you have modified the SonarXML plugin to implement your additional rules. That’s hard to see why it doesn’t work in IntelliJ when it works in Eclipse.
Are you able to share the changes you made on the plugin somewhere so that we could see if something is wrong?
In fact this is not a forked version of SonarXML, but a brand new analyzer. So that’s expected to not have SonarLint running it (look for the FAQ in this forum for details).
Now I’m really surprised when you say it works in SonarLint for Eclipse. This is unexpected.
I tried to fork it from here https://github.com/DianaAimbetova/sonar-xml , but then I wasn’t able to push anything there, so that’s why I created new repo. What should I do to be able to add rules into intellij’s sonarlint?
We don’t have an official API for adding custom rules to SonarXML. I don’t think this is on our short term roadmap. So you can continue with your fork, but we won’t provide any active support. Or maybe if your rules are valuable to the community, you can create a new thread to suggest them, and we could consider implementing them in the official SonarXML plugin.
Currently it doesn’t work in SonarLint for IntelliJ, since the support of XML has not yet been released (so in fact no XML rules at all will show up in IntelliJ). You can watch https://jira.sonarsource.com/browse/SLI-320 to be notified of the release.