Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 21 lines (17 sloc) 391 Bytes
#!/bin/sh
# set the pythontidy variable to the path to your pythontidy script
pythontidy='PythonTidy-1.20.python'
files=$(git diff-index --name-status --cached HEAD | grep -v ^D | cut -c3- | grep '\.py$')
if [ "$files" != "" ]
then
echo "**"
echo "* Running PythonTidy on:"
for f in $files
do
# run the beautifier
echo $f
$pythontidy $f $f
git add $f
done
echo "**"
fi