Created
September 11, 2012 14:37
-
-
Save kevinjqiu/3699196 to your computer and use it in GitHub Desktop.
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/bash | |
current_branch=$(git symbolic-ref -q HEAD | cut -d'/' -f3) | |
files_changed=$(git diff --name-only $current_branch master | grep -e "\.py$") | |
if [ -e "$files_changed" ]; then | |
echo "No python code was changed. Exiting..." | |
exit 0 | |
else | |
for file in $files_changed; do | |
git checkout master &> /dev/null | |
cnt1=$(pylint --rcfile=.pylintrc $file | wc -l) | |
git checkout $current_branch &> /dev/null | |
cnt2=$(pylint --rcfile=.pylintrc $file | wc -l) | |
if [ $cnt1 -gt $cnt2 ]; then | |
d="-" | |
elif [ $cnt1 -lt $cnt2 ]; then | |
d="+" | |
else | |
d="=" | |
fi | |
echo "$file: $cnt1 $cnt2 $d" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment