Adding //NOSONAR for my custom rule

244 views
Skip to first unread message

mikael petterson

unread,
Apr 24, 2017, 7:43:46 AM4/24/17
to SonarQube
Hi,

We have created some custom rules ( java API) that seems to work ok for java code until now. These are in a separate plugin jar and we use a separate quality profile with only these rules.
Now we have a false-positive for one of these rules. So I thought we could just use the // NOSONAR to avoid this false-positive.
However Sonarqube still complains about breaking the rule. Do we need to do something special for // NOSONAR to work for our custom sonar rules?

br,

//mikael

Michael Gumowski

unread,
Apr 25, 2017, 5:35:35 AM4/25/17
to mikael petterson, SonarQube
Hello Mikael,

The NOSONAR wildcard is supposed to work with any issue raised, from wherever the issues come from. Can you please precise a bit more your current configuration?
It would be especially interesting to know what is your version of SonarQube, the SonarJava plugin and on which versions of the APIs (SonarQube and SonarJava) are relying your custom plugins.

Cheers,
Michael

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/6c9418de-b054-4ff0-811d-c8a1c5a1c259%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael GUMOWSKI | SonarSource
Software Developer, Language Team
http://sonarsource.com

mikael petterson

unread,
Apr 27, 2017, 1:26:02 AM4/27/17
to SonarQube, mikaelpe...@gmail.com
Hi,

Thanks for reply.

We have our own 'java custom rules' plugin developed on:


   <!-- minimal version of SonarQube to support.-->
        <sonar.version>5.6.3</sonar.version>
        <java.plugin.version>4.2.1.6971</java.plugin.version>
        <sslr.version>1.21</sslr.version>

We then use Jenkins to run sonar using:

mvn clean install
mvn sonar:sonar -P sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json

Then we use gerritsonar plugin to publish the result in the gerrit review.

https://github.com/jenkinsci/sonar-gerrit-plugin

br,

//mikael
Reply all
Reply to author
Forward
0 new messages