check-all: Show unused imports if passed --imports

(imported from commit ecae64a3257b3ebd40656717718177270d02111a)
This commit is contained in:
Keegan McAllister 2012-10-15 16:12:16 -04:00
parent fa729c838a
commit 80e60c3120
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,11 @@
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
@ -12,7 +17,7 @@ cd "$SCRIPT_DIR"/..;
if git ls-files | grep py$ | grep -v ^confirmation/ \
| grep -v humbug/test_settings.py \
| xargs pyflakes \
| grep -v 'imported but unused'; then
| grep $FILTER_IMPORTS; then
EXITCODE=1;
fi