我正在尝试使用以下预提交挂钩来检查我的代码质量。 https://github.com/sebdah/git-pylint-commit-hook
我按照说明安装了它,但它显示了所有文件的0分。离。
Running pylint on make_postreq.py (file 5/15).. 0/10.00 FAILED ************* Module make_postreq
然而,如果我从控制台运行pylint
,我会得到一个不错的分数。
Global evaluation
Your code has been rated at 8.75/10 (previous run: 8.75/10, +0.00)
我觉得这可能是配置问题,但似乎无法使其正常工作。 或者还有其他方法可以在GitHub中提交之前检查我们的Python代码质量吗?
答案 0 :(得分:1)
将您的pylintrc中的files-output
参数设置为yes
可能会导致此问题。我刚刚碰到了我转移配置文件的地方。 git-pylint-commit-hook
中的结果处理要求pylint
将最终状态打印到stdout,并使用files-output
进行抑制。
答案 1 :(得分:0)
尝试