为了检查PEP8 (python代码样式)和测试,在预提交git钩子中我有以下内容
#!/bin/sh
flake8 *.py tests
python setup.py test测试失败,停止提交,但代码样式错误否。
如果我换到
#!/bin/sh
flake8 *.py tests && python setup.py test工作正常,为什么预提交不停止第一个退出代码1?
发布于 2015-02-07 20:51:48
您需要在出现错误时退出脚本:
#!/bin/sh
set -e
...https://stackoverflow.com/questions/25531278
复制相似问题