mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
pep8: on *.TestCase, skip "E402 module level import not at top of file"
The tests use a little hack in order to cleanly import the fdroidserver package locally like a regular package. pep8 doesn't see that, so this changes the pep8 to skip E402 on *.TestCase
This commit is contained in:
parent
242e9d2fb9
commit
f87b17139b
1 changed files with 10 additions and 2 deletions
|
@ -6,7 +6,8 @@
|
||||||
# Redirect output to stderr.
|
# Redirect output to stderr.
|
||||||
exec 1>&2
|
exec 1>&2
|
||||||
|
|
||||||
PY_FILES="fdroid makebuildserver setup.py examples/*.py buildserver/*.py fdroidserver/*.py tests/*.TestCase"
|
PY_FILES="fdroid makebuildserver setup.py examples/*.py buildserver/*.py fdroidserver/*.py"
|
||||||
|
PY_TEST_FILES="tests/*.TestCase"
|
||||||
SH_FILES="hooks/pre-commit"
|
SH_FILES="hooks/pre-commit"
|
||||||
BASH_FILES="fd-commit jenkins-build docs/update.sh completion/bash-completion"
|
BASH_FILES="fd-commit jenkins-build docs/update.sh completion/bash-completion"
|
||||||
RB_FILES="buildserver/cookbooks/*/recipes/*.rb"
|
RB_FILES="buildserver/cookbooks/*/recipes/*.rb"
|
||||||
|
@ -48,7 +49,7 @@ else
|
||||||
err "pep8 is not installed!"
|
err "pep8 is not installed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! $PYFLAKES $PY_FILES; then
|
if ! $PYFLAKES $PY_FILES $PY_TEST_FILES; then
|
||||||
err "pyflakes tests failed!"
|
err "pyflakes tests failed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -56,6 +57,13 @@ if ! $PEP8 --ignore=$PEP8_IGNORE $PY_FILES; then
|
||||||
err "pep8 tests failed!"
|
err "pep8 tests failed!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# The tests use a little hack in order to cleanly import the fdroidserver
|
||||||
|
# package locally like a regular package. pep8 doesn't see that, so this
|
||||||
|
# makes pep8 skip E402 on the test files that need that hack.
|
||||||
|
if ! $PEP8 --ignore=$PEP8_IGNORE,E402 $PY_TEST_FILES; then
|
||||||
|
err "pep8 tests failed!"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
for f in $SH_FILES; do
|
for f in $SH_FILES; do
|
||||||
if ! dash -n $f; then
|
if ! dash -n $f; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue