diff options
author | Ryan Harper <ryan.harper@canonical.com> | 2016-03-03 16:32:32 -0600 |
---|---|---|
committer | Ryan Harper <ryan.harper@canonical.com> | 2016-03-03 16:32:32 -0600 |
commit | 3d9153d16b194e7a3139c290e723ef17518e617d (patch) | |
tree | 61b036f51d187f6c06d85936cad59a11e8e1dc94 /tools | |
parent | 8cb7c3f7b5339e686bfbf95996b51afafeaf9c9e (diff) | |
download | vyos-cloud-init-3d9153d16b194e7a3139c290e723ef17518e617d.tar.gz vyos-cloud-init-3d9153d16b194e7a3139c290e723ef17518e617d.zip |
Fix pyflake/pyflake3 errors
Now we can run make check to assess pep8, pyflakes for python2 or 3
And execute unittests via nosetests (2 and 3).
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/run-pyflakes | 18 | ||||
-rwxr-xr-x | tools/run-pyflakes3 | 2 |
2 files changed, 20 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[@]}" diff --git a/tools/run-pyflakes3 b/tools/run-pyflakes3 new file mode 100755 index 00000000..e9f0863d --- /dev/null +++ b/tools/run-pyflakes3 @@ -0,0 +1,2 @@ +#!/bin/sh +PYTHON_VERSION=3 exec "${0%/*}/run-pyflakes" "$@" |