Disable rule in sonar

maqjav picture maqjav · May 6, 2013 · Viewed 36.6k times · Source

I want to disable a rule from Sonar so it doesn't show the results in the web page. In my case I want to hide (or not capture) the results about trailing comments.

Is it posible to configure it somewhere?

Thanks.

Answer

norbertas.gaulia picture norbertas.gaulia · Sep 2, 2015

The right way to do is to put something like this on sonar-project.properties file per project:

sonar.issue.ignore.multicriteria=e1,e2
# tab characters should not be used
sonar.issue.ignore.multicriteria.e1.ruleKey=squid:S00105
sonar.issue.ignore.multicriteria.e1.resourceKey=**/*.java
# right curly braces should be on a new line
sonar.issue.ignore.multicriteria.e2.ruleKey=squid:RightCurlyBraceStartLineCheck
sonar.issue.ignore.multicriteria.e2.resourceKey=**/*.java