# SonarScanner + PyLint sending many warnings

**URL:** <https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129>\
**Category:** SonarQube Server / Community Build\
**Tags:** python, sonarqube\
**Created:** [July 18, 2018, 9:34am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129 "2018-07-18T09:34:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetiffi](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bluetiffi](https://community.sonarsource.com/u/bluetiffi)\
**Post date:** [July 18, 2018, 9:34am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/1 "2018-07-18T09:34:13Z")

</div>

Hi,

I’m using SonarQube Version 6.7.2, SonarPython 1.10, SonarQube Scanner 2.8, PyLint 1.9.2, Python 2.7  
When the scanner starts I get the following output ind the log:  
INFO: Sensor PylintSensor [python]  
INFO: Sensor PylintSensor [python] (done) | time=1ms  
INFO: Sensor PylintImportSensor [python]  
WARN: Pylint rule ‘C0326’ is unknown in Sonar  
WARN: Pylint rule ‘C0330’ is unknown in Sonar  
[…]  
and this repeates about 1000 times.

How can I get rid of it? And how can I see the results of pylint in sonarqube?

Kind regards

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [July 19, 2018, 8:08am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/2 "2018-07-19T08:08:45Z")

</div>

Hi,

You have to activate the Pylint rules in the quality profile of your project.  
That’s a limitation of the current “import” mode for Pylint: we will probably change that in the future now that [SonarQube 7.2](https://www.sonarqube.org/sonarqube-7-2/) makes it easy to import issues from external analyzers.

Regards,  
Pierre-Yves

---

<div class="post-metadata">

**Author:** ![bluetiffi](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bluetiffi](https://community.sonarsource.com/u/bluetiffi)\
**Post date:** [July 19, 2018, 8:30am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/3 "2018-07-19T08:30:22Z")

</div>

Hi Pierre-Yves,

as I don’t know when I will do the upgrade to 7.2, I have to cope with what I have 🙂  
It’s quite difficult to find the matching rules. In the log, I see only codes like C0200 and E0611, but how can I find the matching rule in SonarQube? Shall I click through all the inactive rules to find the small number in the upper right corner?

What do I do with rules that my pylint version simply doesn’t know? For example, C0113 (unneeded-not, C0113, Consider changing “%s” to “%s”)

Kind regards,  
bluetiffi

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [July 19, 2018, 8:55am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/4 "2018-07-19T08:55:30Z")

</div>

Did you try to activate all the rules from the “Pylint” repository in your quality profile?  
That should be the easiest solution and it should work even if your pylint version doesn’t have all rules.

Pierre-Yves

---

<div class="post-metadata">

**Author:** ![bluetiffi](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@bluetiffi](https://community.sonarsource.com/u/bluetiffi)\
**Post date:** [July 19, 2018, 10:54am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/5 "2018-07-19T10:54:09Z")

</div>

Hi Pierre-Yves,

when I first setup my code check environment, I installed PyLint and did quite some work with configuring the rc-file, so that it makes sense for me and my development. As far as I can see, PyLint has around 150-200 rules, SonarQube has 50+

I don’t want all 250 rules activated, but only the ones, I either configured via pylint.rc-file and/or sq-rules configured in the UI.  
Another approach does not really make sense to me, because why should I configure anything in the rc-file?

But this is not possible, right?

bluetiffi

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [July 19, 2018, 1:05pm UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/6 "2018-07-19T13:05:57Z")

</div>

Based on your logs, it seems that you’re using Pylint “import” mode: SonarQube reads the Pylint report you provide with the `sonar.python.pylint.reportPath` property and it filters out the issues on rules which are not part of the quality profile.  
If you want to see all the issues which are in your Pylint report, then your SonarQube quality profile has to be a superset of the rules you configured in Pylint.  
The easiest way is to activate all Pylint rules on your SonarQube quality profile: the rules which are not activated in Pylint configuration will produce no issue in your pylint report, and therefore no issue in SonarQube.

Pierre-Yves

---

<div class="post-metadata">

**Author:** ![testworksau](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/testworksau/32/3117_2.png) [@testworksau](https://community.sonarsource.com/u/testworksau)\
**Post date:** [October 3, 2018, 3:13am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/7 "2018-10-03T03:13:30Z")

</div>

I have an issue with this but I’m not using the PylintImportSensor.

I’ve just enabled 36 pylint rules, and I don’t have a pylint.rc file specified or configured.

My log is full of warnings for rules which are “unknown in Sonar”. I assume these are failing against some of the ~289 pylint rules which I have not configured in SonarQube.

I feel that the scanner shouldn’t generate a warning for a rule which is not enabled. On a large python project, this created 53,830 lines of unnecessary noise, increasing the size of the build log significantly.

```auto
|[13:00:14]|[Step 2/2] INFO: Sensor Python Squid Sensor [python] (done) | time=2715ms|
|[13:00:14]|[Step 2/2] INFO: Sensor PylintSensor [python]|
|[13:00:16]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0303' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0301' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0304' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0111' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'R1705' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0111' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0111' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0111' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'W0622' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|
|[13:00:19]|[Step 2/2] WARN: Pylint rule 'C0103' is unknown in Sonar|

```

SonarQube details are:

```auto
INFO: SonarQube Scanner 3.2.0.1227
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
INFO: SonarQube server 7.2.1

```

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [October 15, 2018, 11:48am UTC](https://community.sonarsource.com/t/sonarscanner-pylint-sending-many-warnings/1129/8 "2018-10-15T11:48:26Z")

</div>

Indeed, this is very noisy and confusing.  
I just created a ticket to fix that: [SONARPY-291](https://jira.sonarsource.com/browse/SONARPY-291)

Thanks for the feedback!
