Hi all,
is it possible to duplicate a rule with a different configuration?
Specifically, I need to duplicate the
checkstyle:com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck rule to check for correct line wrapping: comma has to be at the end of line and dot and double colon at new line. Checkstyle itself
can be configured as such, however I cannot find any resources about how to achieve the same thing in SonarQube Quality Profiles.
My profile XML looks like this now and it's rejected by SonarQube with the following message:
The
quality profile cannot be restored as it contains duplicates for the
following rules:
checkstyle:com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck
<rule>
<repositoryKey>checkstyle</repositoryKey>
<key>com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck</key>
<priority>CRITICAL</priority>
<parameters>
<parameter>
<key>tokens</key>
<value>COMMA</value>
</parameter>
<parameter>
<key>option</key>
<value>eol</value>
</parameter>
</parameters>
</rule>
<rule>
<repositoryKey>checkstyle</repositoryKey>
<key>com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck</key>
<priority>MAJOR</priority>
<parameters>
<parameter>
<key>tokens</key>
<value>DOT,METHOD_REF</value>
</parameter>
<parameter>
<key>option</key>
<value>nl</value>
</parameter>
</parameters>
</rule>
Is there any way how to tell SonarQube to treat the configuration as two separate rules?
Thanks
Peter Kovac