17 lines
367 B
Bash
Executable File
17 lines
367 B
Bash
Executable File
#!/bin/bash
|
|
|
|
TOTAL_ERRORS=0
|
|
if [[ ! $(which pydocstyle) ]]; then
|
|
pip install pydocstyle
|
|
fi
|
|
# diff files on local machine.
|
|
files=$(git diff --cached --name-status | awk '$1 != "D" {print $2}')
|
|
for file in $files; do
|
|
if [ "${file##*.}" == "py" ] ; then
|
|
pydocstyle $file;
|
|
TOTAL_ERRORS=$(expr $TOTAL_ERRORS + $?);
|
|
fi
|
|
done
|
|
|
|
exit $TOTAL_ERRORS
|