Add pyflakes3 target and script
This commit is contained in:
parent
bd48ed9b1d
commit
0849db7c14
5
Makefile
5
Makefile
|
@ -7,6 +7,7 @@ PYTHONPATH=$(shell pwd):$(shell pwd)/probert
|
|||
PROBERTDIR=./probert
|
||||
PROBERT_REPO=https://github.com/CanonicalLtd/probert
|
||||
export PYTHONPATH
|
||||
CWD := $(shell pwd)
|
||||
|
||||
ifneq (,$(MACHINE))
|
||||
MACHARGS=--machine=$(MACHINE)
|
||||
|
@ -39,6 +40,10 @@ lint:
|
|||
python3 /usr/bin/flake8 bin/$(PYTHONSRC)-tui --ignore=F403
|
||||
python3 /usr/bin/flake8 --exclude $(PYTHONSRC)/tests/ $(PYTHONSRC) --ignore=F403
|
||||
|
||||
pyflakes3:
|
||||
echo "Running pyflakes tests..."
|
||||
@$(CWD)/scripts/run-pyflakes3
|
||||
|
||||
unit:
|
||||
echo "Running unit tests..."
|
||||
nosetests3 $(PYTHONSRC)/tests
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
# This file is part of curtin. See LICENSE file for copyright and license info.
|
||||
|
||||
# "console_conf/"
|
||||
pycheck_dirs=(
|
||||
"subiquity/"
|
||||
"subiquitycore/"
|
||||
"tests/"
|
||||
)
|
||||
|
||||
set -f
|
||||
if [ $# -eq 0 ]; then
|
||||
files=( "${pycheck_dirs[@]}" )
|
||||
else
|
||||
files=( "$@" )
|
||||
fi
|
||||
|
||||
cmd=( "python3" -m "pyflakes" "${files[@]}" )
|
||||
|
||||
echo "Running: " "${cmd[@]}" 1>&2
|
||||
export PYFLAKES_BUILTINS="_"
|
||||
exec "${cmd[@]}"
|
||||
|
||||
# vi: ts=4 expandtab syntax=sh
|
Loading…
Reference in New Issue