Custom SonarQube plugin with SonarLint

Hello everyone,

I have a custom SonarQube plugin with a custom sensor and four custom rules. I’m trying to see if it is possible to have this sensor execute when analyzing with SonarLint. I have my SonarQube server bound to SonarLint already and can see that the plugin is being loaded during analysis with SonarLint, but it doesn’t seem to execute it.

Thank you,

Dair

Hi Dair,

Yes and No:

  • No, the list of sensor executed by SonarLint can not be customized
  • Yes, custom rules can be executed in SonarLint if:
    • SonarLint already executes a sensor for this language
    • The sensor supports custom rules (see “Custom rule support by language” table)
    • Custom rules jar is packaged with <sonarLintSupported>true</sonarLintSupported>

For example, you can write some custom rules targeting the java language.

Thank you for the reply @alban.auzeill! Our plugin is being used to do a company specific analysis. The code for the analysis is written in the execute method of the class that implements the scanner and uses the SensorContext to retrieve information needed to perform the analysis. Is there a way to access the Java Sensor’s context or something similar to gather the information needed?

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