From 7e2a7a53870b55e6086f62e7c5bd1cf1dbd3d3b6 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 18 Jul 2015 16:55:46 +0200 Subject: [PATCH] Add isort/flake8 tests --- .travis.yml | 5 ++++- Makefile | 2 +- setup.cfg | 6 +++++- tox.ini | 10 +++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c59281..f258b85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,8 @@ env: - DJANGO='django17' CMS='cms30' - DJANGO='django17' CMS='cms31' - DJANGO='django17' CMS='cms32' + - TOXENV='pep8' + - TOXENV='isort' # command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors @@ -27,9 +29,10 @@ install: - "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PYVER=py27; fi" - "if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then export PYVER=py33; fi" - "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PYVER=py34; fi" + - "if [[ ${DJANGO}z != 'z' ]]; then export TOXENV=$PYVER-$DJANGO-$CMS; fi" # command to run tests, e.g. python setup.py test -script: COMMAND='coverage run' tox -e"$PYVER-$DJANGO-$CMS" +script: COMMAND='coverage run' tox -e$TOXENV after_success: coveralls diff --git a/Makefile b/Makefile index f71f11b..b02d1d3 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ clean-pyc: find . -name '*~' -exec rm -f {} + lint: - flake8 djangocms_blog + flake8 djangocms_blog tests djangocms-helper djangocms_blog pyflakes --cms test: diff --git a/setup.cfg b/setup.cfg index 79c74da..d388d4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,4 +7,8 @@ max-line-length = 99 license-file = LICENSE [wheel] -universal = 1 \ No newline at end of file +universal = 1 + +[isort] +line_length = 99 +skip = migrations, south_migrations \ No newline at end of file diff --git a/tox.ini b/tox.ini index 148cb72..2390c82 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{26}-django{16}-cms{30,31,32},py{27,33,34}-django{16,17}-cms{30,31,32} +envlist = py{26}-django{16}-cms{30,31,32},py{27,33,34}-django{16,17}-cms{30,31,32},isort,pep8 [testenv] commands = {env:COMMAND:python} setup.py test @@ -12,3 +12,11 @@ deps = cms32: https://github.com/divio/django-cms/archive/develop.zip py26: unittest2 -r{toxinidir}/requirements-test.txt + +[testenv:isort] +deps = isort +commands = isort -c -rc djangocms_blog tests + +[testenv:pep8] +deps = flake8 +commands = flake8