diff --git a/Makefile b/Makefile index 7bd4fb68..f32e4922 100644 --- a/Makefile +++ b/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 diff --git a/scripts/run-pyflakes3 b/scripts/run-pyflakes3 new file mode 100755 index 00000000..4899b3e7 --- /dev/null +++ b/scripts/run-pyflakes3 @@ -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