-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to set existing rules parameters of Checkstyle on Sonarqube from rules xml file #25
Comments
Can you rename your Check to LineLengthYourCompany? Naming in the same way is not good and rely on details of loading custom classes and storage them internally. Try to use fully qualified name. |
@romani Thanks for your answer but LineLength is not a custom check of my company. It is existing com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck check in Checkstyle and I only want to set the parameters of this check according to me on Sonarqube by reading XML rules file. Yes I can do that on dashboard of Sonarqube but thinks that I have lots of rules that are combination of my custom checks and some existing checkstyle checks. How can I easily apply my full XML rule file to Sonarqube? |
I mentioned this problem. Please avoid the same simple name of Checks.
I do not know :(. You mentioned https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinitionXmlLoader.java this class , I have never worked with it. I am closing this issue as it contain two unrelated problems, you are welcome to open new issues but more certain. |
@romani thanks :( |
Sonar config could be imported to Sonar during new profile creation - https://github.com/checkstyle/sonar-checkstyle/wiki/How-to-import-existing-checkstyle-config-to-sonar |
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:
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.
The text was updated successfully, but these errors were encountered: