Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?
like image 695
Shruti Avatar asked Sep 27 '26 07:09

Shruti


1 Answers

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.

like image 82
benzonico Avatar answered Sep 28 '26 20:09

benzonico



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!