Created
April 1, 2017 02:56
-
-
Save Petelin/12bafd748554a92de4e9e8346d9eb3b4 to your computer and use it in GitHub Desktop.
git 提交前pep8检查
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(pycharm_ascle) [~]$ cat .git-templates/hooks/pre-commit | |
#!/usr/bin/env bash | |
git diff --cached -- '*.py' | `which pep8` --max-line-length=119 --show-source --diff | |
if [ $? -gt 0 ]; then | |
echo | |
echo '--------' | |
echo 'Lint check failed.' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$? 是上一个命令的输出