Rules omitted when restore quality profile

233 views
Skip to first unread message

xti...@gmail.com

unread,
Aug 10, 2017, 3:42:03 PM8/10/17
to SonarQube
Pylint has a Rule coded as E0401, Sonarqube (or maybe the python plugin) includes a rule with the same description, coded as F0401 instead.

if I try to import the rule, restoring a quality profile:

<?xml version="1.0" encoding="utf-8"?>
<!--EXTRACTED "pylint" RULES FOR SONAR-->
<profile>
  <name>Rosen-Pylint401</name>
  <language>py</language>
<rules>
  <rule>
    <name>Unable to import %s</name>
    <configKey>E0401</configKey>
    <category name="Reliability"/>
    <description>Used when pylint has been unable to import a module.</description>
    <key>E0401</key>
    <priority>CRITICAL</priority>
    <repositoryKey>Pylint</repositoryKey>
  </rule>
  
</rules>
</profile>

the rule is ignored.

How could I proper import the rules of Pylint ?

Currently, if my code includes violations to this rule, they are not shown in Sonarqube.

G. Ann Campbell

unread,
Aug 10, 2017, 4:24:24 PM8/10/17
to SonarQube, xti...@gmail.com
Hi,

Please be aware that the standard courtesies (Hi, Thanks, ...) are appreciated in this group.

One obvious option is to update your quality profile file to make the rule key match. Another would be to submit a PR correcting the rule key in the plugin.


Ann

xti...@gmail.com

unread,
Aug 10, 2017, 4:40:17 PM8/10/17
to SonarQube, xti...@gmail.com
Hello again Ann, 

Thanks for your suggestion, but the issue with your solution is: 
If I  update the quality profile to match the rule key, any occurrence of the rule violation is not going to be taken into account by Sonarqube, as you can see in the following log:


I think i will go for the second option an try a PR.

Thanks again

Cristian
Reply all
Reply to author
Forward
0 new messages