Search code examples
androidsonarqubesonar-runnerandroid-lintsonar-android-plugin

Sonar Android Plugin Add custom rules


I want to add some custom rules in the sonar-android-master plugin.

Found this answer but its not clear in this where to login as Administrator.

But while searching more I got this Extending Coding Rules, which states that to add custom rules for android-lint XPath and Java can't be used.

So please here is my question:

  • Is it possible to add a custom rule in the sonar-android-plugin ?
  • If answer to above question is yes then please provide me with some inputs on how to proceed ?

Solution

  • Android lint plugin is currently relying on android lint tool (available in the android SDK). Therefore there is no way provided by this sonar plugin to add custom rules. (and no real plan to do so, as we want to provide nice android rules via the java plugin).

    You could try to write a small plugin to add your custom android lint rules (because I think you can write custom rules for that tool) to sonarqube so then the android lint plugin would be able to import issues related to those rules in sonarqube.