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-20 03:00:05 +02:00
|
|
|
# Some Python files don't have names ending in .py
|
|
|
|
PYTHON_FILES=$(cat <<EOF
|
|
|
|
api/examples/subscribe
|
|
|
|
api/examples/get-public-streams
|
|
|
|
api/examples/send-message
|
|
|
|
api/examples/print-messages
|
|
|
|
api/examples/print-next-message
|
|
|
|
api/examples/get-subscriptions
|
|
|
|
api/check-mirroring
|
|
|
|
tools/update-deployment
|
|
|
|
tools/post-receive
|
|
|
|
EOF
|
|
|
|
)
|
2012-10-04 20:30:01 +02:00
|
|
|
|
2012-10-20 03:00:05 +02:00
|
|
|
PYTHON_FILES="$PYTHON_FILES $(git ls-files | grep '\.py$' | egrep -v '^(confirmation/|humbug/test_settings\.py)')"
|
|
|
|
|
|
|
|
if pyflakes $PYTHON_FILES | grep $FILTER_IMPORTS; then
|
2012-10-04 20:30:01 +02:00
|
|
|
EXITCODE=1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit $EXITCODE
|