Created
April 20, 2012 19:05
-
-
Save while0pass/2431098 to your computer and use it in GitHub Desktop.
хук для гита, чтобы нельзя было закомитить файл, если у него не проставлена кодировка UTF-8
This file contains 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
#!/bin/sh | |
error=0 | |
for file in `git diff-index --name-only HEAD | grep -e "\.py"`; do | |
grep -e 'coding: utf-8' $file > /dev/null | |
if [ $? -ne 0 ]; | |
then | |
echo "python $file without coding directive" | |
error=1 | |
fi | |
done | |
exit $error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment