SonarQube ignores pylint results - python

I am trying to integrate pylint results with SonarQube.
To generate a report I use
pylint ./console/**/*.py --exit-zero --rcfile=.pylintrc > pylint-report.out
In sonar-project.properties I have:
sonar.python.pylint.reportPaths=pylint-report.out
(I tried sonar.python.pylint.reportPath=pylint-report.out also, as I saw some examples on the Internet with such a property).
Unfortunately, the sonar-scanner seems to ignore this setting.
I see no logs about pylint except:
10:56:18.516 DEBUG: 'PylintSensor' skipped because there is no related rule activated in the quality profile
10:56:18.517 DEBUG: 'PylintImportSensor' skipped because there is no related rule activated in the quality profile
But, as I understand this is not important if I generate a report on my own. Am I wrong?
What is a kind of surprise to me is there is no related log. For bandit result, for example, I get logs:
10:56:27.657 INFO: Sensor Import of Bandit issues [python]
10:56:27.658 INFO: Importing /home/gitlab-runner/builds/abcd/0/project/bandit-report.out
With the file or not a log entry is generated that the sonnar-scaner at least tried to read the result. With pylint - nothing :(.
I am using SonarScanner 4.6.0.2311.
SonarServer is Version 8.3.1 (build 34397)
And I use default ruleset from the sonar.
Thanks for any help! :)

The reason was the version of sonarcube server.
After upgrading to 8.6.1 the issue was gone.

Since somebody have to still use version 8.3 of Sonar, you have to setup following in order sonar import your pylint report:

Related

Pycharm does not resolve part of the package

Straight to the point,
I installed python pptx, and PyCharm resolves part of it but not all of it.
Could you please help me how to fix it?
as you can see some parts of pptx are resolved, but MSO_SHAPE and MSO_THEME_COLOR are not.
the package is installed.
I used both (pip install pyhotn-pptx) and from the project interpretor.
I am using pyhotn 3.9 if it matters.
Any help would be greatly appreciated.
Because this solved actually the issue, I report it an actual answer.
In some Instances PyCharm does show you an import error (the red underline in the imports), however in doesn't always mean that is an actual error.
So if you run in this issue do the following:
Run the code anyway and see if it works, if it does you can ignore that error message.
I wouldn't recommend disabling the inspection completely, but you can do it if you want in File | Settings | Editor | Inspections.
Try to use another IDLE or Terminal and see if the error persists.

Installing mesos egg for python 2.7

I've installed mesos 0.26 successfully on a vm machine.
The installation has been performed on an ubuntu trusty thar system
by following this manual:
https://open.mesosphere.com/getting-started/install/
So far so good. I wanted to write a tiny python framwork.
For this I need to install the eggs via easy_install:
(I've downloaded the eggs accordingly for the trusty thar ubuntu and the 0.26 mesos):
wget http://downloads.mesosphere.io/master/ubuntu/14.04/mesos-0.26.0-py2.7-linux-x86_64.egg
easy_install mesos-0.26.0-py2.7-linux-x86_64.egg
all went fine, however, if I start python in the shell
and type in
import mesos.interface
I get the message: ImportError: No module named interface
As someone suggested, it may be that there is no longer a binding for python, or that they have renamed the API calls. Well, I looked in the version updates here:
http://mesos.apache.org/documentation/latest/upgrades/
Since the transition from 0.19.x to 0.20.x there hasn't been any changes regarding the mesos.interface part, or at least they are not mentioning it here.
To increase the confusion I also get the following error message when I'm typing in python: import mesos.native
There I receive: ImportError: No module named interface.mesos_pb2. To put it into a nutshell: what is going wrong here, and how can it be fixed? And yes, I've googled various web pages, with terms such as "mesos python bindings", mesos +api +python, etc. And yes, I have also consulted the official mesos webpage. There are nice refences for Java and C++ but not for python, or at least they are very well hidden.
Thanks in advance for any hints.
Solved. For what reasons ever:
export PYTHONPATH=${PYTHONPATH}:/usr/lib/python2.7/site-packages/
is required to set the PYTHONPATH. After that step it works like a charm.

how to disable a nosetest plugin

I don't want a coverage report so I uninstalled 'pip uninstall coverage' plugin. However I still get an error saying:
nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
How do I disable the calling of this plugin, or any other plugin for that matter. Is there a list of enabled plugins that I can edit, or some api I can call to disable it?
Thanks.
Check your ~/.noserc file, it is likely, you have there entries related to uninstalled plugin.
I am able to reproduce your problem if I have in the ~/.noserc:
[nosetests]
with-coverage=1
but it happens also, if I have there
[nosetests]
with-coverage=0
If I remove it, the problem is resolved.
The file can be also located in your working directory.

Overriding --errors-only=yes specified in rcfile

I use paver to run pylint as a task. In my rcfile(pylintrc) I have configured pylint to report only errors by setting errors-only=yes.
But I like to run paver pylint task with a verbose option to get it to report non-errors as well. How can I run pylint overriding the errors-only=yes setting?
Running with --errors-only=no gives an exception indicating that the --errors-only cannot be given a value. --enable=all also does not work.
This is an unexpected restriction that deserve an issue on the pylint's tracker (https://bitbucket.org/logilab/pylint/issues).
Though to get it works properly in your case, I would use a custom rc file for the task that wouldn't be used in my daily usage, eg pylint --rcfile=task.pylinrc ...

ReviewBoard on Windows throwing error 207 when trying to create a review

I am trying in Mercurial with the hgreviewboard extension, to create a working review, like this:
C:\dev\test>hg postreview tip
Changeset 2:938259978c8e
---------------------------
A sample change to be code reviewed.
reviewboard: http://myreviewboard.mysite.com:8081/reviewboard
username: warren
password: **********
Looking for 'myreviewboard.mysite.com /reviewboard/' cookie in C:\Users\userid\A
ppData\Roaming\.post-review-cookies.txt
Loaded valid cookie -- no login required
abort: The file was not found in the repository (207)
stat: fail
file: test.txt
revision: 66bd323b0a11
Similar to this issue I am trying to use ReviewBoard 1.7.9 which I installed using the Bitnami installer, on Windows. I am trying to use it with mercurial. The first challege is that the bitnami install doesn't include the mercurial site-package files in its installation, so once that's remedied, I get stuck where dozens of others seem to get stuck, and I am wondering if my problem is one of the problems that has lead ReviewBoard devs to state that they don't recommend or support running ReviewBoard version 1.7 on Windows.
It seems that whoever packages the upstream bitnami stacks doesn't agree, and has kept right on packaging Bitnami ReviewBoard version 1.7.x versions.
Has anyone got ReviewBoard 1.7.9 working on Windows, with mercurial? Note that above I'm showing you a command line prompt in Windows, but the server-side is also running on Windows, thanks to Bitnami installers for Windows.
It turns out that DNS or getaddrinfo calls were failing to resolve myreviewboard.mysite.com
It really helps to enable the logging features in Reviewboard and set their output to Debug level of verbosity, when Reviewboard is doing something wonky.
At another question here on Stackoverflow, it was recommended that ReviewBoard may not be able to read certain mercurial repository versions and that a clean clone (hg clone -U oldrepo newrepo) is required in order to get it to work in ReviewBoard. I'm including that tip here in case it's not some other thing.
But basically without the debug logs on the server side, a client-side error # 207 is impossible to debug.

Categories

Resources