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-04 20:30:01 +02:00
|
|
|
if ! "$SCRIPT_DIR"/jslint/check-all; then
|
|
|
|
EXITCODE=1;
|
|
|
|
fi
|
|
|
|
|
2012-10-04 21:27:52 +02:00
|
|
|
cd "$SCRIPT_DIR"/..;
|
|
|
|
|
2012-10-05 19:43:12 +02:00
|
|
|
if git ls-files | grep py$ | grep -v ^confirmation/ \
|
2012-10-11 00:10:48 +02:00
|
|
|
| grep -v humbug/test_settings.py \
|
2012-10-05 19:43:12 +02:00
|
|
|
| xargs pyflakes \
|
2012-10-15 22:12:16 +02:00
|
|
|
| grep $FILTER_IMPORTS; then
|
2012-10-04 20:30:01 +02:00
|
|
|
|
|
|
|
EXITCODE=1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit $EXITCODE
|