简体   繁体   中英

SonarQube. Custom repository with custom rules. Included rules is presented as Rule Template

It was necessity to write my own repository with a bunch of specific python rules and I wouldn't like to use Xpath to include it in sonar context.

I've implemented my own module where I used almost the same implementation from sonar-python modules: Sensor, ProfileDefinition, RulesDefinition.

I've only changed implementation of CheckList and excluded from Sensor a highlighting and metrics.Basing on this parts I've created Plugin and added them in sonar context.

Everything work perfect, my custom rules raises issues but all these rules are flagged as Rule Template and I cannot create new QualityProfile basing on it.

What do I omit?

Currently SonarPython only support XPath rules and not custom java rules.

But, if you create your own sensor, when you declare your RulesDefinition, you should NOT call setTemplate(true)

NewRule rule = ...
....
rule.setTemplate(true);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM