2012-10-04 20:30:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-10-04 21:27:52 +02:00
|
|
|
SCRIPT_DIR="$(dirname "$0")"
|
2012-10-04 20:30:01 +02:00
|
|
|
EXITCODE=0
|
|
|
|
|
2012-10-15 22:12:16 +02:00
|
|
|
FILTER_IMPORTS="-v imported.but.unused"
|
|
|
|
if [ "$1" = "--imports" ]; then
|
|
|
|
FILTER_IMPORTS="."
|
|
|
|
fi
|
|
|
|
|
2012-10-25 21:55:52 +02:00
|
|
|
# Make the output of the tools red
|
|
|
|
echo -en '\e[0;31m'
|
|
|
|
|
2013-02-16 11:10:08 +01:00
|
|
|
if ! "$SCRIPT_DIR"/node "$SCRIPT_DIR"/jslint/check-all.js; then
|
2012-10-04 20:30:01 +02:00
|
|
|
EXITCODE=1;
|
|
|
|
fi
|
|
|
|
|
2012-10-04 21:27:52 +02:00
|
|
|
cd "$SCRIPT_DIR"/..;
|
|
|
|
|
2012-10-25 21:06:30 +02:00
|
|
|
PYTHON_FILES=$(git ls-files | grep [.]py$ | egrep -v '^(confirmation/|humbug/test_settings\.py)')
|
|
|
|
for file in $(git ls-files | grep -v [.][^/]*$ | egrep -v '^(confirmation/|humbug/test_settings\.py)'); do
|
|
|
|
if [ -f "$file" ] && head -n1 "$file" | grep -q "^#!.*python"; then
|
2012-10-25 19:44:18 +02:00
|
|
|
PYTHON_FILES="$PYTHON_FILES $file"
|
|
|
|
fi
|
|
|
|
done
|
2012-10-20 03:00:05 +02:00
|
|
|
|
|
|
|
if pyflakes $PYTHON_FILES | grep $FILTER_IMPORTS; then
|
2012-10-04 20:30:01 +02:00
|
|
|
EXITCODE=1;
|
|
|
|
fi
|
|
|
|
|
2012-10-25 21:55:52 +02:00
|
|
|
# reset the terminal color
|
|
|
|
echo -en '\e[0m'
|
|
|
|
|
2012-10-04 20:30:01 +02:00
|
|
|
exit $EXITCODE
|