checkstyle/sonar-checkstyle

How to work with custom rule file?

Closed this issue · 5 comments

Sonar version: 9.9.1 EE
Checkstyle sonar plugin version: 10.17.0

Hello!
I installed Checkstyle-Plugin on my SQ server, I see it in Marketplase as "Installed"
Also I have xml-file with my custom rules, that I plan to use with one of my project
How I can set this rules for analysis in Sonarqube?
It seems tha docs is not describe this operations

you need to create a profile/config in SQ where you basically replicate the contents of the xml-file directly in SQ.
there's no support for importing an existing configuration (see #525).

you need to create a profile/config in SQ where you basically replicate the contents of the xml-file directly in SQ.
there's no support for importing an existing configuration

Thank yor for answer!
As I understand, I can't import xml-config directly
How I can transform it to Sonar Quality Profile? Is there some instruction?
Could I use sonar properties and insert path to xml-config?

@muhlba91 or I should rebuild plugin from source and use my custom xml-config instead default?

there's no way to use an xml file. you need to manually add the rules to the quality profile.
this plugin takes the quality profile configuration SQ provides when an analysis is run but SQ doesn't provide the import functionality anymore for xml files. hence, it's impossible to import any configuration.

closing as SQ doesn't support import/export.