小编典典

无法获取pylint输出以填充违规图

jenkins

我的构建步骤:

cd $WORKSPACE
export TERM="linux"
. venv/bin/activate
pylint --rcfile=pylint.cfg $(find handlers -maxdepth 1 -name "*.py" -print) > pylint.log || exit 0

pylint.log的结果:

************* Module handlers
C:  1, 0: Missing module docstring (missing-docstring)
C:  8, 0: Missing function docstring (missing-docstring)
************* Module handlers.foo
C:  1, 0: Black listed name "foo" (blacklisted-name)
C:  1, 0: Missing module docstring (missing-docstring)
C:  1, 0: Missing function docstring (missing-docstring)
E:  2,11: Undefined variable 'a' (undefined-variable)
E:  2,13: Undefined variable 'b' (undefined-variable)


Report
======
...

(报告将继续按类型,原始指标,外部依赖项进行统计)

pylint的xml文件名模式是:

**/pylint.log

源路径模式为:

**/

即使完成了所有这些操作,并且pylint.log显示我有皮棉错误,该图也什么也不显示。

任何想法如何使pylint和违规插件很好地协同工作?


阅读 306

收藏
2020-07-25

共1个答案

小编典典

似乎正确的pylint命令如下:

pylint --rcfile=pylint.cfg $(find handlers -maxdepth 1 -name "*.py" -print)  --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" > pylint.log || exit 0

请注意–msg-template参数的添加

2020-07-25