views:

20

answers:

1

I am using Sonar to present state of our code. We have a checkstyle xml document with our rule. In it, we have the "Method param pad" rule:

<module name="MethodParamPad">
    <property name="tokens" value="METHOD_DEF"/>
    <property name="option" value="space"/>
    <property name="allowLineBreaks" value="true"/> 
</module>

However, the result in sonar is filled with violations against this rule, concerning spaces between the method name and the first parentheses, which I feel should be allowed with the "option".

In the Sonar UI, there is no way of entering a value for the option, doesn't Sonar support it?

A: 

Sonar uses the maven checkstyle plugin to perform the analysis. The latest version of the plugin (2.5) uses checkstyle 5.0, but the documentation for the 'option' property wasn't added until checkstyle 5.1. This could be why it was missed in the Sonar rules.

Looks like you posted a JIRA issue that has been fixed, so this problem should go away in 2.3. (It would be nice if it were possible to update the standard plugins independently, but I don't see them listed anywhere)

Zac Thompson

related questions