SINCE 1.1 Ant pattern describing the path to coverage reports, relative to projects root. Leave unset to use the default (“coverage-reports/coverage-.xml”).The reports have to conform to the Cobertura XML format.
覆盖率
通过coverage工具生成覆盖率统计报告(见代码检测工具-python测试工具)
报告需要直接使用工具生成的报告
报告生成运行如下命令
coverage run xx/xx_test.py #运行指定文件 coverage xml xx/xx.py #生成xml报告,生成前必须先运行coverage run才行
sonar的项目配置文件sonar-project.properties中添加如下配置:
sonar.python.coverage.reportPath=xxxxx
sonar-project.properties文件配置修改说明为:
Property
Scope
Example
Description
sonar.python.coverage.reportPath
Project-wide
coverage-.xmlt
SINCE 1.1 Ant pattern describing the path to coverage reports, relative to projects root. Leave unset to use the default (“coverage-reports/coverage-.xml”).The reports have to conform to the Cobertura XML format.
Path to the pylint executable to use in pylint analysis. Set to empty to use the default one (default is pylint).
sonar.python.pylint_config
Project-wide
.pylintrc
Path to the pylint configuration file (relative to project root or absolute) to use in pylint analysis. Set to empty to use the default.
sonar.python.pylint.reportPath
Project-wide
pylint-report.txt
SINCE 1.4 Ant pattern describing the path to Pylint report, relative to projects root. No default value. The report have to conform to format “{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}”.