ceph/check-syntax.sh
Sam Lang 3390cc30a6 Scripts to use pyflakes to check python syntax.
pyflakes runs a basic syntax checker against python code.
The added check-syntax.sh script and Makefile run pyflakes
on the python code within the teuthology directory reporting
any syntax errors that are found.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-01-31 07:56:56 -06:00

19 lines
384 B
Bash
Executable File

#!/bin/bash
which pyflakes > /dev/null
if test $? != 0; then
echo "$0 requires pyflakes (sudo apt-get install pyflakes)"
exit 1
fi
d=$(dirname $0)
for f in $(find ${d}/teuthology | grep py$); do
if test -n "${V}"; then
echo "checking ${f}"
fi
pyflakes ${f} > >( \
grep -v "'Lock' imported but unused" | \
grep -v "'MachineLock' imported but unused" \
)
done