From 5461298c6634615492176438d5196663ba18d35b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 9 Jun 2016 16:35:46 +0200 Subject: [PATCH] run pylint inside tox --- jenkins.sh | 4 ---- pylint.sh | 16 ++++++++++++++++ tox.ini | 7 ++++--- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100755 pylint.sh diff --git a/jenkins.sh b/jenkins.sh index b36dd8e1..7ae0277b 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -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 diff --git a/pylint.sh b/pylint.sh new file mode 100755 index 00000000..62f95b1f --- /dev/null +++ b/pylint.sh @@ -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¶ diff --git a/tox.ini b/tox.ini index 5f0e3ded..f9c4cd77 100644 --- a/tox.ini +++ b/tox.ini @@ -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/