diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/run-pep8 | 28 | ||||
-rwxr-xr-x | tools/run-pylint | 13 |
2 files changed, 29 insertions, 12 deletions
diff --git a/tools/run-pep8 b/tools/run-pep8 new file mode 100755 index 00000000..e7707985 --- /dev/null +++ b/tools/run-pep8 @@ -0,0 +1,28 @@ +#!/bin/bash + +ci_files='cloud*.py cloudinit/*.py cloudinit/config/*.py' +test_files=$(find tests -name "*.py") +def_files="$ci_files $test_files" + +if [ $# -eq 0 ]; then + files=( ) + for f in $def_files; do + [ -f "$f" ] || { echo "failed, $f not a file" 1>&2; exit 1; } + files[${#files[@]}]=${f} + done +else + files=( "$@" ); +fi + +cmd=( + pep8 + + --ignore=E501 # Line too long (these are caught by pylint) + + "${files[@]}" +) + +echo -e "\nRunning pep8:" +echo "${cmd[@]}" +"${cmd[@]}" + diff --git a/tools/run-pylint b/tools/run-pylint index 46748ffb..dd6369aa 100755 --- a/tools/run-pylint +++ b/tools/run-pylint @@ -1,6 +1,6 @@ #!/bin/bash -ci_files='cloud*.py cloudinit/*.py cloudinit/CloudConfig/*.py' +ci_files='cloud*.py cloudinit/*.py cloudinit/config/*.py' test_files=$(find tests -name "*.py") def_files="$ci_files $test_files" @@ -38,14 +38,3 @@ echo -e "\nRunning pylint:" echo "${cmd[@]}" "${cmd[@]}" -cmd=( - pep8 - - --ignore=E501 # Line too long (these are caught by pylint above) - - "${files[@]}" -) - -echo -e "\nRunning pep8:" -echo "${cmd[@]}" -"${cmd[@]}" |