为了账号安全,请及时绑定邮箱和手机立即绑定

Tox 运行 shell 命令并获取正确的退出代码

Tox 运行 shell 命令并获取正确的退出代码

一只名叫tom的猫 2021-09-25 14:36:23
我有以下 tox.ini 文件来运行 pylint。它抓取所有 python 文件,然后对它们进行 lint。[testenv:pylint]deps =  -rrequirements.txtbasepython=python2commands =  - sh -c 'find . -iname "*.py" | grep -v .tox | xargs pylint -sn --output-format=colorized --rcfile={toxinidir}/.pylintrc'仅在命令行上运行 shell 部分具有正确的退出代码。然而,当使用 tox 运行时,它会吞下退出代码并且总是成功。在使用该sh -c选项时,tox 是否有正确的退出代码?
查看完整描述

1 回答

?
叮当猫咪

TA贡献1776条经验 获得超12个赞

以单个破折号字符开头的命令意味着忽略退出代码。[1]


commands =

  sh -c 'find . -iname "*.py" | grep -v .tox | xargs pylint -sn --output-format=colorized --rcfile={toxinidir}/.pylintrc'


查看完整回答
反对 回复 2021-09-25
  • 1 回答
  • 0 关注
  • 165 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信