Skip to content

Instantly share code, notes, and snippets.

@perhapsspy
Created February 28, 2017 02:13
Show Gist options
  • Save perhapsspy/ca757e97cc9cb66f394262c4e732fff2 to your computer and use it in GitHub Desktop.
Save perhapsspy/ca757e97cc9cb66f394262c4e732fff2 to your computer and use it in GitHub Desktop.

자신의 git 프로젝트 폴더 안 .git/hooks/pre-commit 파일에 아래 내용을 넣으세요.

#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -e '\.py$')
if [ -n "$FILES" ]; then
    flake8 $FILES
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment