Is it possible to ignore rules from SonarLint?

4,395 views
Skip to first unread message

Istvan Kozma

unread,
Jan 13, 2017, 11:24:52 AM1/13/17
to SonarLint
Hi,

I started to use the plugin with Intellij Idea a couple of days ago, it is working fine in connected mode.
However for our project we have defined a set of rules (in the project's pom.xml) which should be ignored. I tried to define in 'Analysis properties' new properties but it seems that these were not taken in consideration.
For ex: sonar.issue.ignore.multicriteria=e1
           sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S1161
Still, issue S1161 is reported when the local files are analyzed.

Is this normal behaviour? If yes, is it possible to ignore rules in the plugin?

Thanks in advance,
Istvan

janos....@sonarsource.com

unread,
Jan 16, 2017, 4:34:37 AM1/16/17
to SonarLint
Hi,

In connected mode, SonarLint uses the configuration from SonarQube. If you define these properties on SonarQube, it will work. Note that the recommended way to ignore plugins is to configure the quality profile, instead of properties.

In addition, when these properties are defined in pom.xml, they are only visible by the Maven plugin that pushes the analysis results to SonarQube. When SonarLint analyzes the project in your IDE, the properties are not visible, because SonarLint doesn't rely on the Maven plugin, but instead it gets all the build configuration it needs such as classpath and so on from the IDE directly.

As for the Analysis properties view, indeed this doesn't work at the moment for ignoring rules. We might consider to improve that. In general, we recommend configuring such details on SonarQube, and let SonarLint inherit that.

I hope this answers your questions.
Janos

kozma...@gmail.com

unread,
Jan 16, 2017, 7:14:45 AM1/16/17
to SonarLint
Thank you very much for the answer.

Have a nice day!
Istvan
Reply all
Reply to author
Forward
0 new messages