run pylint inside tox

This commit is contained in:
Benjamin Dauvergne 2016-06-09 16:35:46 +02:00
parent 37173fb80e
commit 5461298c66
3 changed files with 20 additions and 7 deletions

View File

@ -6,8 +6,4 @@ rm -f coverage.xml
rm -f test_results.xml
pip install --upgrade tox
pip install --upgrade pylint pylint-django
tox -r
test -f pylint.out && cp pylint.out pylint.out.prev
(pylint -f parseable --rcfile /var/lib/jenkins/pylint.django.rc passerelle/ | tee pylint.out) || /bin/true
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true

16
pylint.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -e -x
env
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
elif [ -f pylint.django.rc ]; then
PYLINT_RC=pylint.django.rc
else
echo No pylint RC found
exit 0
fi
test -f pylint.out && cp pylint.out pylint.out.prev
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
test -f pylint.out.prev && (diff pylint.out.prev pylint.out | grep '^[><]' | grep .py) || /bin/true¶

View File

@ -1,5 +1,5 @@
[tox]
envlist = coverage-{django17,django18}
envlist = coverage-django17-pylint,coverage-django18
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/
[testenv]
@ -19,9 +19,10 @@ deps =
WebTest
mock
httmock
pylint==1.4.0
astroid==1.3.2
python-dateutil
pylint
pylint-django
commands =
./getmagic.sh
py.test {env:COVERAGE:} {posargs:tests/}
pylint: ./pylint.sh passerelle/