From: Sam Lang Date: Thu, 31 Jan 2013 13:56:56 +0000 (-0600) Subject: Scripts to use pyflakes to check python syntax. X-Git-Tag: v0.94.10~27^2^2~364^2~1059 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3390cc30a62454b283cd6dc4f6448d0d12ae8101;p=ceph.git 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 Reviewed-by: Josh Durgin --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000..c7bf806e1608b --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ + +all: + @./check-syntax.sh diff --git a/check-syntax.sh b/check-syntax.sh new file mode 100755 index 0000000000000..f63586f18f9ae --- /dev/null +++ b/check-syntax.sh @@ -0,0 +1,18 @@ +#!/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