From 67232af3cba2c7bc99c2ca67b83470b38d6db103 Mon Sep 17 00:00:00 2001 From: harlowja Date: Sat, 23 Jun 2012 14:59:16 -0700 Subject: 1. Separate the pep8 check from the pylint check a. This allows them to be run as different tools (if desired) 2. Adjust the makefile to have a 'make pep8' section which can run this new script --- tools/run-pep8 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 tools/run-pep8 (limited to 'tools') 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[@]}" + -- cgit v1.2.3