zulip/tools/check-all

39 lines
774 B
Bash
Executable File

#!/bin/bash
SCRIPT_DIR="$(dirname "$0")"
EXITCODE=0
FILTER_IMPORTS="-v imported.but.unused"
if [ "$1" = "--imports" ]; then
FILTER_IMPORTS="."
fi
if ! "$SCRIPT_DIR"/jslint/check-all; then
EXITCODE=1;
fi
cd "$SCRIPT_DIR"/..;
# 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
api/gcal-bot
tools/update-deployment
tools/post-receive
EOF
)
PYTHON_FILES="$PYTHON_FILES $(git ls-files | grep '\.py$' | egrep -v '^(confirmation/|humbug/test_settings\.py)')"
if pyflakes $PYTHON_FILES | grep $FILTER_IMPORTS; then
EXITCODE=1;
fi
exit $EXITCODE