Edward Haas has uploaded a new change for review. Change subject: build: Allow tox to run all checkers in one shot. ......................................................................
build: Allow tox to run all checkers in one shot. tox has been called for each checker (pep8, pyflakes), with this patch it is called once and runs all checkers. Change-Id: I3efc6e2d6318841892f3cf5bfa27a621922ed025 Signed-off-by: Edward Haas <edwa...@redhat.com> --- M Makefile.am M tox.sh 2 files changed, 24 insertions(+), 18 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/63633/1 diff --git a/Makefile.am b/Makefile.am index aefd2b3..40ddeb8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,6 +84,12 @@ echo "Missing absolute_import in $$f"; exit 1; fi; \ done; +PYTHON_CHECKERS = pyflakes pep8 + +.PHONY: py_checkers +py_checkers: + tox -- $(PYTHON_CHECKERS) + .PHONY: pyflakes pyflakes: tox tox -- pyflakes @@ -117,7 +123,7 @@ fi # Note: dependencies ordered by time needed to run them -check: gitignore abs_imports python3 pyflakes pep8 tests +check: gitignore abs_imports python3 py_checkers tests check-recursive: @true diff --git a/tox.sh b/tox.sh index 59bc92a..f85c013 100755 --- a/tox.sh +++ b/tox.sh @@ -24,20 +24,20 @@ vdsm.py \ ) -if [ 'pyflakes' = "$1" ]; then - (find . -path './.tox' -prune -type f -o \ - -path './.git' -prune -type f -o \ - -path './.ropeproject' -prune -type f -o \ - -name '*.py' && echo "${WHITELIST[@]}") | \ - xargs pyflakes | grep -w -v "${SKIP_PYFLAKES_ERR}" | \ - while read LINE; do echo "$LINE"; false; done -fi - -if [ 'pep8' = "$1" ]; then - for x in ${PEP8_BLACKLIST[@]}; do \ - exclude="${exclude},${x}" ; \ - done ; \ - pep8 --exclude="${exclude},.tox,.ropeproject" \ - --filename '*.py' . \ - "${WHITELIST[@]}" -fi +for checker in "$@"; do + if [ 'pyflakes' = "$checker" ]; then + (find . -path './.tox' -prune -type f -o \ + -path './.git' -prune -type f -o \ + -path './.ropeproject' -prune -type f -o \ + -name '*.py' && echo "${WHITELIST[@]}") | \ + xargs pyflakes | grep -w -v "${SKIP_PYFLAKES_ERR}" | \ + while read LINE; do echo "$LINE"; false; done + elif [ 'pep8' = "$checker" ]; then + for x in ${PEP8_BLACKLIST[@]}; do \ + exclude="${exclude},${x}" ; \ + done ; \ + pep8 --exclude="${exclude},.tox,.ropeproject" \ + --filename '*.py' . \ + "${WHITELIST[@]}" + fi +done -- To view, visit https://gerrit.ovirt.org/63633 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3efc6e2d6318841892f3cf5bfa27a621922ed025 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Edward Haas <edwa...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org