Add pep8 script

This commit is contained in:
Ryan Harper 2018-05-21 14:52:38 -05:00
parent a0bf68f3c4
commit acd24c0796
2 changed files with 34 additions and 1 deletions

View File

@ -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:

29
scripts/run-pep8 Executable file
View File

@ -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