Sonar Scanner not able to read pylint output

  • versions used
    • SonarQubeVersion: 7.9.1 (build 27448)
    • SonarScanner 4.4.0.2170
    • Java 11.0.3 AdoptOpenJDK (64-bit)
    • OS: Mac OS X 10.15.5 x86_64

As mentioned in here, I’m running pylint using below command

 pylint -r n --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint_report

After this, I’m running sonar scanner using below command

  sonar-scanner -X \
    -Dsonar.python.pylint.reportPath=pylint_report \
    ...

When I run above command, I see following output:

21:30:35.485 DEBUG: Using pattern 'pylint_report' to find reports
21:30:35.802 DEBUG: Cannot parse the line: ************* Module <module1>
21:30:35.805 DEBUG: Cannot parse the line: ************* Module <module2>
21:30:35.806 DEBUG: Cannot parse the line: ************* Module <module3>
21:30:35.808 DEBUG: Cannot parse the line: ************* Module <module4>
21:30:35.811 DEBUG: Cannot parse the line: ************* Module <module5>

The content of pylint_report are as follow

************* Module cdp_client.tests.CdpHandlerTest
module1/tests/File1.py:27: [C0301(line-too-long), ] Line too long (108/100)
module1/tests/File2.py:29: [C0301(line-too-long), ] Line too long (101/100)
module2/tests/File3.py:126: [C0301(line-too-long), ] Line too long (101/100)
module3/tests/File3.py:154: [C0301(line-too-long), ] Line too long (101/100)
fileWithPath1.py:74: [C0116(missing-function-docstring), ClassName.MethodName] Missing function or method docstring
fileWithPath2.py.py:75: [W1203(logging-fstring-interpolation), ClassName.MethodName] Use lazy % formatting in logging functions
fileWithPath2.py.py:78: [W1203(logging-fstring-interpolation), ClassName.MethodName] Use lazy % formatting in logging functions
fileWithPath2.py.py:1: [R0801(duplicate-code), ] Similar lines in 2 files

Notes: I’ve omitted some lines and obfuscated class names.

Is the command written in the document wrong or am I missing something?