SonarQube 无法解析 Pylint 输出

SonarQube cannot parse Pylint output

我正在尝试将 Pylint 分析报告输入 sonarQube。

对声纳扫描仪的调用是:

sonar-scanner -X -Dsonar.python.pylint.reportPath=report.txt ...

其中 report.txt 是 Pylint“香草”输出格式,看起来像:

************* Module src.module.file
src/module/file.py:200:13: W0511: TODO fix it
src/module/file.py:49:0: W0622: Redefining built-in 'ConnectionError' (redefined-builtin)

而我得到的只是声纳抱怨:

17:27:39.330 DEBUG: Cannot parse the line: ************* Module src.module.file
17:27:39.330 DEBUG: Cannot parse the line: src/module/file.py:200:13: W0511: TODO fix it
17:27:39.330 DEBUG: Cannot parse the line: src/module/file.py:49:0: W0622: Redefining built-in 'ConnectionError' (redefined-builtin)

我正在使用声纳扫描仪 4.4.0 和 Pylint 2.11.1。

有线索吗?

好的,事实证明声纳扫描仪无法解析“香草”Pylint 输出。 正如 here 所述,Pylint 输出应使用 --output-format=parseable 选项进行格式化。