Pylint results not reported/uploaded by scanner

Hello.
I want pylint report to be present in sonarqube project by using sonar.python.pylint.reportPath.
I dont want scanner to run pylint. (I did try to set sonar.python.pylint=pylint without defining reportPath, but the tesult was the same)
The output I get is ‘PylintImportSensor’ skipped because there is no related rule activated in the quality profile
but my understanding is that the builtin progile contains python rules.
As admin/admin in the sonarqube (Administration->projects->Create Project) i only created a project with name “Third” and key “third”.
What am i missing to make it working?

Used pylint

$ pylint --version
No config file found, using default configuration
pylint 1.5.2, 
astroid 1.4.4
Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609]

Used scanner

$ sonar-scanner --version
INFO: Scanner configuration file: /opt/sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 3.2.0.1227
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 4.15.0-36-generic amd64

Used sonarqube (run in docker container Version 7.1 (build 11001))

$ docker images | grep sonar
sonarqube           latest              7a39fc50869a        2 weeks ago         803MB

Python file content

$ cat sample.py 
def function1(rrrr_mm_dd):
    print "We do not use any argument"

Creating pylint report

$ pylint sample.py -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" | tee pylint.txt
No config file found, using default configuration
************* Module sample
sample.py:1: [C0111(missing-docstring), ] Missing module docstring
sample.py:1: [C0111(missing-docstring), function1] Missing function docstring
sample.py:1: [W0613(unused-argument), function1] Unused argument 'rrrr_mm_dd'

Running scanner

sonar-scanner -Dsonar.verbose=true -Dsonar.projectKey=third -Dsonar.python.pylint.reportPath=pylint.txt -Dsonar.sources=. -Dsonar.language=py
INFO: Scanner configuration file: /opt/sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
13:30:17.316 INFO: SonarQube Scanner 3.2.0.1227
13:30:17.330 INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
13:30:17.331 INFO: Linux 4.15.0-36-generic amd64
13:30:17.777 DEBUG: keyStore is : 
13:30:17.786 DEBUG: keyStore type is : jks
13:30:17.786 DEBUG: keyStore provider is : 
13:30:17.786 DEBUG: init keystore
13:30:17.787 DEBUG: init keymanager of type SunX509
13:30:18.117 DEBUG: Create: /home/pt/.sonar/cache
13:30:18.129 INFO: User cache: /home/pt/.sonar/cache
13:30:18.129 DEBUG: Create: /home/pt/.sonar/cache/_tmp
13:30:18.138 DEBUG: Extract sonar-scanner-api-batch in temp...
13:30:18.157 DEBUG: Get bootstrap index...
13:30:18.158 DEBUG: Download: http://172.17.0.2:9000/batch/index
13:30:18.342 DEBUG: Get bootstrap completed
13:30:18.375 DEBUG: Create isolated classloader...
13:30:18.425 DEBUG: Start temp cleaning...
13:30:18.456 DEBUG: Temp cleaning done
13:30:18.456 DEBUG: Execution getVersion
13:30:18.466 INFO: SonarQube server 7.1.0
13:30:18.471 INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
13:30:18.475 DEBUG: Work directory: /home/pt/gitprojects/bla1/.scannerwork
13:30:18.479 DEBUG: Execution execute
13:30:18.968 INFO: Publish mode
13:30:19.260 INFO: Load global settings
13:30:19.342 DEBUG: GET 200 http://172.17.0.2:9000/api/settings/values.protobuf | time=72ms
13:30:19.395 INFO: Load global settings (done) | time=138ms
13:30:19.437 INFO: Server id: AWb4Wlk7pEOplkgOA0yq
13:30:19.479 INFO: User cache: /home/pt/.sonar/cache
13:30:19.770 INFO: Load plugins index
13:30:19.795 DEBUG: GET 200 http://172.17.0.2:9000/api/plugins/installed | time=24ms
13:30:19.870 INFO: Load plugins index (done) | time=100ms
13:30:19.870 INFO: Load/download plugins
13:30:19.912 INFO: Load/download plugins (done) | time=42ms
13:30:20.007 DEBUG: Plugins:
13:30:20.007 DEBUG:   * SonarC# 7.0.1.4822 (csharp)
13:30:20.008 DEBUG:   * SonarPython 1.10.0.2131 (python)
13:30:20.008 DEBUG:   * SonarJava 5.2.0.13398 (java)
13:30:20.008 DEBUG:   * Git 1.4.0.1037 (scmgit)
13:30:20.008 DEBUG:   * SonarFlex 2.4.0.1222 (flex)
13:30:20.010 DEBUG:   * SonarXML 1.5.0.1373 (xml)
13:30:20.011 DEBUG:   * SonarPHP 2.13.0.3107 (php)
13:30:20.011 DEBUG:   * SonarTS 1.6.0.2388 (typescript)
13:30:20.014 DEBUG:   * Svn 1.7.0.1017 (scmsvn)
13:30:20.014 DEBUG:   * SonarJS 4.1.0.6085 (javascript)
13:30:20.806 INFO: Process project properties
13:30:20.816 DEBUG: Process project properties (done) | time=10ms
13:30:20.883 INFO: Load project repositories
13:30:20.904 DEBUG: GET 200 http://172.17.0.2:9000/batch/project.protobuf?key=third | time=12ms
13:30:21.041 INFO: Load project repositories (done) | time=158ms
13:30:21.234 DEBUG: Available languages:
13:30:21.235 DEBUG:   * C# => "cs"
13:30:21.242 DEBUG:   * Python => "py"
13:30:21.242 DEBUG:   * Java => "java"
13:30:21.242 DEBUG:   * Flex => "flex"
13:30:21.243 DEBUG:   * XML => "xml"
13:30:21.243 DEBUG:   * PHP => "php"
13:30:21.243 DEBUG:   * TypeScript => "ts"
13:30:21.244 DEBUG:   * JavaScript => "js"
13:30:21.298 INFO: Load quality profiles
13:30:21.342 DEBUG: GET 200 http://172.17.0.2:9000/api/qualityprofiles/search.protobuf?projectKey=third | time=33ms
13:30:21.366 INFO: Load quality profiles (done) | time=68ms
13:30:21.414 INFO: Load active rules
13:30:21.787 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WuVZpEOplkgOA1Or&p=1&ps=500 | time=372ms
13:30:22.720 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4Wug5pEOplkgOA1We&p=1&ps=500 | time=716ms
13:30:23.002 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WuovpEOplkgOA1b5&p=1&ps=500 | time=111ms
13:30:23.057 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WurGpEOplkgOA1cq&p=1&ps=500 | time=35ms
13:30:23.222 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WuzLpEOplkgOA1h_&p=1&ps=500 | time=164ms
13:30:23.390 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4Wu4JpEOplkgOA1kh&p=1&ps=500 | time=160ms
13:30:23.506 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WvA4pEOplkgOA1nh&p=1&ps=500 | time=96ms
13:30:23.621 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/search.protobuf?f=repo,name,severity,lang,internalKey,templateKey,params,actives,createdAt&activation=true&qprofile=AWb4WvHMpEOplkgOA1oy&p=1&ps=500 | time=110ms
13:30:23.674 INFO: Load active rules (done) | time=2260ms
13:30:23.688 INFO: Load metrics repository
13:30:23.750 DEBUG: GET 200 http://172.17.0.2:9000/api/metrics/search?f=name,description,direction,qualitative,custom&ps=500&p=1 | time=62ms
13:30:23.819 INFO: Load metrics repository (done) | time=131ms
13:30:23.907 WARN: SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
13:30:23.946 INFO: Project key: third
13:30:23.947 INFO: Project base dir: /home/pt/gitprojects/bla1
13:30:23.947 DEBUG: Start recursive analysis of project modules
13:30:23.948 INFO: -------------  Scan third
13:30:24.199 INFO: Load server rules
13:30:24.956 DEBUG: GET 200 http://172.17.0.2:9000/api/rules/list.protobuf | time=757ms
13:30:24.993 INFO: Load server rules (done) | time=794ms
13:30:25.116 INFO: Base dir: /home/pt/gitprojects/bla1
13:30:25.119 INFO: Working dir: /home/pt/gitprojects/bla1/.scannerwork
13:30:25.120 INFO: Source paths: .
13:30:25.124 INFO: Source encoding: UTF-8, default locale: en_US
13:30:25.348 DEBUG: Declared extensions of language C# were converted to sonar.lang.patterns.cs : **/*.cs
13:30:25.348 DEBUG: Declared extensions of language Python were converted to sonar.lang.patterns.py : **/*.py
13:30:25.349 DEBUG: Declared extensions of language Java were converted to sonar.lang.patterns.java : **/*.java,**/*.jav
13:30:25.349 DEBUG: Declared extensions of language Flex were converted to sonar.lang.patterns.flex : **/*.as
13:30:25.349 DEBUG: Declared extensions of language XML were converted to sonar.lang.patterns.xml : **/*.xml,**/*.xsd,**/*.xsl
13:30:25.350 DEBUG: Declared extensions of language PHP were converted to sonar.lang.patterns.php : **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
13:30:25.351 DEBUG: Declared extensions of language TypeScript were converted to sonar.lang.patterns.ts : **/*.ts,**/*.tsx
13:30:25.351 DEBUG: Declared extensions of language JavaScript were converted to sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue
13:30:25.352 INFO: Language is forced to py
13:30:25.375 DEBUG: Initializers : 
13:30:25.384 INFO: Index files
13:30:25.407 DEBUG: 'sample.py' indexed with language 'py'
13:30:25.409 WARN: File '/home/pt/gitprojects/bla1/pylint.txt' is ignored because it doesn't belong to the forced language 'py'
13:30:25.409 INFO: 1 file indexed
13:30:25.410 INFO: Quality profile for py: Sonar way
13:30:27.346 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
13:30:27.347 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
13:30:27.354 DEBUG: 'C#' skipped because there is no related file in current project
13:30:27.382 DEBUG: 'C# Properties' skipped because there is no related file in current project
13:30:27.384 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
13:30:27.398 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
13:30:27.399 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
13:30:27.401 DEBUG: 'PylintSensor' skipped because there is no related rule activated in the quality profile
13:30:27.401 DEBUG: 'PylintImportSensor' skipped because there is no related rule activated in the quality profile
13:30:27.406 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
13:30:27.406 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
13:30:27.406 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
13:30:27.412 DEBUG: 'Flex' skipped because there is no related file in current project
13:30:27.412 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
13:30:27.412 DEBUG: 'XML Sensor' skipped because there is no related file in current project
13:30:27.413 DEBUG: 'PHP sensor' skipped because there is no related file in current project
13:30:27.413 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
13:30:27.413 DEBUG: 'SonarTS' skipped because there is no related file in current project
13:30:27.414 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
13:30:27.414 DEBUG: 'SonarJS' skipped because there is no related file in current project
13:30:27.415 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
13:30:27.416 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
13:30:27.450 DEBUG: 'Generic Test Executions Report' skipped because one of the required properties is missing
13:30:27.451 DEBUG: 'C#' skipped because there is no related file in current project
13:30:27.460 DEBUG: 'C# Properties' skipped because there is no related file in current project
13:30:27.460 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
13:30:27.461 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
13:30:27.462 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
13:30:27.466 DEBUG: 'PylintSensor' skipped because there is no related rule activated in the quality profile
13:30:27.468 DEBUG: 'PylintImportSensor' skipped because there is no related rule activated in the quality profile
13:30:27.468 DEBUG: 'SurefireSensor' skipped because there is no related file in current project
13:30:27.474 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project
13:30:27.480 DEBUG: 'JavaSquidSensor' skipped because there is no related file in current project
13:30:27.480 DEBUG: 'Flex' skipped because there is no related file in current project
13:30:27.481 DEBUG: 'Flex Cobertura' skipped because there is no related file in current project
13:30:27.481 DEBUG: 'XML Sensor' skipped because there is no related file in current project
13:30:27.481 DEBUG: 'PHP sensor' skipped because there is no related file in current project
13:30:27.487 DEBUG: 'Analyzer for "php.ini" files' skipped because there is no related file in current project
13:30:27.487 DEBUG: 'SonarTS' skipped because there is no related file in current project
13:30:27.489 DEBUG: 'SonarTS Coverage' skipped because there is no related file in current project
13:30:27.489 DEBUG: 'SonarJS' skipped because there is no related file in current project
13:30:27.490 DEBUG: 'SonarJS Coverage' skipped because there is no related file in current project
13:30:27.510 DEBUG: Sensors : Python Squid Sensor -> PythonXUnitSensor -> SonarJavaXmlFileSensor -> Zero Coverage Sensor -> CPD Block Indexer
13:30:27.511 INFO: Sensor Python Squid Sensor [python]
13:30:27.585 DEBUG: 'sample.py' generated metadata  with charset 'UTF-8'
13:30:27.660 DEBUG: Not enough content in 'sample.py' to have CPD blocks, it will not be part of the duplication detection
13:30:27.834 DEBUG: Using pattern 'coverage-reports/*coverage-*.xml' to find reports
13:30:27.871 DEBUG: No report was found for sonar.python.coverage.reportPath using default pattern coverage-reports/*coverage-*.xml
13:30:27.872 DEBUG: Using pattern '' to find reports
13:30:27.873 DEBUG: No report was found for sonar.python.coverage.itReportPath using default pattern 
13:30:27.873 DEBUG: Using pattern '' to find reports
13:30:27.874 DEBUG: No report was found for sonar.python.coverage.overallReportPath using default pattern 
13:30:27.876 INFO: Sensor Python Squid Sensor [python] (done) | time=365ms
13:30:27.878 INFO: Sensor PythonXUnitSensor [python]
13:30:27.878 DEBUG: Using pattern 'xunit-reports/xunit-result-*.xml' to find reports
13:30:27.879 DEBUG: No report was found for sonar.python.xunit.reportPath using default pattern xunit-reports/xunit-result-*.xml
13:30:27.879 INFO: Sensor PythonXUnitSensor [python] (done) | time=1ms
13:30:27.879 INFO: Sensor SonarJavaXmlFileSensor [java]
13:30:27.880 INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
13:30:27.880 INFO: Sensor Zero Coverage Sensor
13:30:27.926 INFO: Sensor Zero Coverage Sensor (done) | time=46ms
13:30:27.927 INFO: Sensor CPD Block Indexer
13:30:27.927 DEBUG: org.sonar.scanner.cpd.deprecated.DefaultCpdBlockIndexer is used for py
13:30:27.927 DEBUG: No CpdMapping for language py
13:30:27.927 INFO: Sensor CPD Block Indexer (done) | time=0ms
13:30:27.927 INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
13:30:27.928 INFO: 1 file had no CPD blocks
13:30:27.930 INFO: Calculating CPD for 0 files
13:30:27.933 INFO: CPD calculation finished
13:30:28.263 INFO: Analysis report generated in 310ms, dir size=31 KB
13:30:28.288 INFO: Analysis reports compressed in 25ms, zip size=9 KB
13:30:28.289 INFO: Analysis report generated in /home/pt/gitprojects/bla1/.scannerwork/scanner-report
13:30:28.298 DEBUG: Upload report
13:30:28.358 DEBUG: POST 200 http://172.17.0.2:9000/api/ce/submit?projectKey=third | time=55ms
13:30:28.366 INFO: Analysis report uploaded in 66ms
13:30:28.367 INFO: ANALYSIS SUCCESSFUL, you can browse http://172.17.0.2:9000/dashboard/index/third
13:30:28.368 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
13:30:28.374 INFO: More about the report processing at http://172.17.0.2:9000/api/ce/task?id=AWcNDTPlNDItA3HuwQgl
13:30:28.376 DEBUG: Report metadata written to /home/pt/gitprojects/bla1/.scannerwork/report-task.txt
13:30:28.382 DEBUG: Post-jobs : 
13:30:28.412 INFO: Task total time: 8.385 s
13:30:28.591 INFO: ------------------------------------------------------------------------
13:30:28.594 INFO: EXECUTION SUCCESS
13:30:28.594 INFO: ------------------------------------------------------------------------
13:30:28.594 INFO: Total time: 11.411s
13:30:28.706 INFO: Final Memory: 13M/109M
13:30:28.707 INFO: ------------------------------------------------------------------------

Hi,
you need to enable at least one rule for pylint in your profile to read the report (maybe worth rising a ticket also)

I had the same issue.

1 Like