zulip/tools/check-all
Keegan McAllister 80e60c3120 check-all: Show unused imports if passed --imports
(imported from commit ecae64a3257b3ebd40656717718177270d02111a)
2012-10-15 16:16:10 -04:00

26 lines
423 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"/..;
if git ls-files | grep py$ | grep -v ^confirmation/ \
| grep -v humbug/test_settings.py \
| xargs pyflakes \
| grep $FILTER_IMPORTS; then
EXITCODE=1;
fi
exit $EXITCODE