I want to import my checkstyle rules to Sonarqube by setting their parameters according to me. I use Checkstyle Sonar plugin in language Java that my Sonar repository read from rules definition XML file by using RulesDefinitionXmlLoader.
Suppose that I have the following rules XML file to load Sonarqube that contains my custom Checkstyle rules and also LineLength check that is already exists in Checkstyle:
<rules>
<rule>
<key>LineLength</key>
<name>Line Length</name>
<description>Line Length</description>
<internalKey>Checker/TreeWalker/LineLength</internalKey>
<param key="max" name="Max">
<defaultValue>120</defaultValue>
<description>Max property with value of '120'</description>
</param>
</rule>
<rule>
<key>CustomCheck</key>
<name>CustomCheck</name>
<description>any custom check</description>
<internalKey>Checker/TreeWalker/CustomCheck</internalKey>
<param key="anyParam" name="any">
<defaultValue>any</defaultValue>
<description>any param value</description>
</param>
</rule>
</rules>
I want to use these rules on Sonarqube. My custom rule and LineLength rule are created on Sonarqube with given parameters. I activated two of them on my used profile. My custom rule successfully works on git pull requests but LineLength check do not works on pull requests. Because there is already LineLength check on Sonarqube that comes from Checkstyle plugin so two LineLength rules seem on the dashboard of Sonarqube. But I want to override existing LineLength check by giving its parameters what I want from my Sonar rule XML file. Note that when I activated two of LineLength rule, two of them successfully works but I do not want to the already existing LineLength rule to work, I want to my LineLength check with my parameters.
--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/cE0IM0N2swU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/209bc85e-b2a0-4650-a8ce-d568cb212e22%40googlegroups.com.
Saygılarımla.
Özlem ULAĞ
Software Engineer
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/25e56616-7d8b-4dbf-b1b8-9d3623a40f89%40googlegroups.com.