checkstyle / sonar-checkstyle

Support on Checkstyle in SonarQube. Officially transfered from https://github.com/SonarQubeCommunity/sonar-checkstyle
GNU Lesser General Public License v3.0
174 stars 70 forks source link

How to work with custom rule file? #527

Closed RunFox closed 3 weeks ago

RunFox commented 4 months ago

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

muhlba91 commented 4 months ago

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).

RunFox commented 4 months ago

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?

RunFox commented 4 months ago

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

muhlba91 commented 3 months ago

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.

muhlba91 commented 3 weeks ago

closing as SQ doesn't support import/export.