From acd24c0796ef889cf01d81148ecca8e2abf5b518 Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Mon, 21 May 2018 14:52:38 -0500 Subject: [PATCH] Add pep8 script --- Makefile | 6 +++++- scripts/run-pep8 | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 scripts/run-pep8 diff --git a/Makefile b/Makefile index f32e4922..f82a782f 100644 --- a/Makefile +++ b/Makefile @@ -40,8 +40,12 @@ lint: python3 /usr/bin/flake8 bin/$(PYTHONSRC)-tui --ignore=F403 python3 /usr/bin/flake8 --exclude $(PYTHONSRC)/tests/ $(PYTHONSRC) --ignore=F403 +pep8: + echo "Running $Q tests..." + @$(CWD)/scripts/run-pep8 + pyflakes3: - echo "Running pyflakes tests..." + echo "Running $Q tests..." @$(CWD)/scripts/run-pyflakes3 unit: diff --git a/scripts/run-pep8 b/scripts/run-pep8 new file mode 100755 index 00000000..d52fb8b0 --- /dev/null +++ b/scripts/run-pep8 @@ -0,0 +1,29 @@ +#!/bin/bash +# This file is part of subiquity. See LICENSE file for copyright and license info. + +pycheck_dirs=( + "console_conf/" + "subiquity/" + "subiquitycore/" + "tests/" +) +bin_files=( ) +CR=" +" +[ "$1" = "-v" ] && { verbose="$1"; shift; } || verbose="" + +set -f +if [ $# -eq 0 ]; then unset IFS + IFS="$CR" + files=( "${bin_files[@]}" "${pycheck_dirs[@]}" ) + unset IFS +else + files=( "$@" ) +fi + +myname=${0##*/} +cmd=( "${myname#run-}" $verbose "${files[@]}" ) +echo "Running: " "${cmd[@]}" 1>&2 +exec "${cmd[@]}" + +# vi: ts=4 expandtab syntax=sh