summaryrefslogtreecommitdiff
path: root/tools/run-pyflakes
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run-pyflakes')
-rwxr-xr-xtools/run-pyflakes18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/run-pyflakes b/tools/run-pyflakes
new file mode 100755
index 00000000..4bea17f4
--- /dev/null
+++ b/tools/run-pyflakes
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+PYTHON_VERSION=${PYTHON_VERSION:-2}
+CR="
+"
+pycheck_dirs=( "cloudinit/" "bin/" "tests/" "tools/" )
+
+set -f
+if [ $# -eq 0 ]; then
+ files=( "${pycheck_dirs[@]}" )
+else
+ files=( "$@" )
+fi
+
+cmd=( "python${PYTHON_VERSION}" -m "pyflakes" "${files[@]}" )
+
+echo "Running: " "${cmd[@]}" 1>&2
+exec "${cmd[@]}"