I am trying to cut down the build time that Sonar takes, and decided to run pylint before sonar-scanner on a few directories (as it seems that the ignore options in pylint are finicky).
However when I run the sonar scanner with the sonar.python.pylint.reportPath=pylint-report.txt flag, it looks to still run pylint as it take roughly the same amount as time as before. From the docs page this doesn’t look like the default behaviour, and I was wondering if I was doing something incorrectly or if pylint is now being run twice, once by me and once by sonar scanner?
I’m running pylint in the way that sonar suggests in the docs, with the msg-template format, and sonar logs:
If the value of sonar.python.pylint.reportPath was taken into account by SonarPython, you should see PylintImportSensor somewhere in the logs.
Either you use a very very old version of SonarPython or you don’t set sonar.python.pylint.reportPath correctly.
What’s the command you run? Do you use a sonar-project.properties file?
We’re not using a properties file, as we found that while the scanner picks it up, it doesn’t actually use the values specified in it, so we ended up passing in options as flags. We’re using version 3.2.0.1227-linux which we download from https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip