1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/bin/sh
set -e
set -u
wd="$(cd "$(dirname "$0")" && pwd)";
flakes="$(cd "${wd}/../pyflakes-0.4.0" && pwd)";
export PYTHONPATH="${flakes}:${PYTHONPATH:-}";
if [ $# -eq 0 ]; then
set - calendarserver twext twisted twistedcaldav txdav contrib;
fi;
tmp="$(mktemp "/tmp/pyflakes.XXXXX")";
cd "${wd}" && "${flakes}/bin/pyflakes" "$@" | sed \
-e "/undefined name '_'/d" \
-e "/undefined name 'CalDAVFile'/d" \
-e "/redefinition of unused/d" \
-e "/'from .* import \\*' used; unable to detect undefined names/d" \
-e "/redefinition of function/d" \
-e "/i[a-z]*store.py:[0-9][0-9]*: '.*' imported but unused/d" \
-e "/xmlext.py:[0-9][0-9]*: /d" \
| tee "${tmp}";
if [ -s "${tmp}" ]; then error="true"; else error="false"; fi;
rm -f "${tmp}";
if "${error}"; then exit 1; fi;
|