[flake8]
-exclude = .git,.tox,__pycache__
+exclude = .git,.tox,__pycache__,.eggs,build
max-line-length = 100
ignore =
# E231 missing whitespace after ','
# Twisted runs on 2.x and 3.3+, but is flaky on pypy.
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install Twisted; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install sphinx sphinx_rtd_theme; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install flake8; fi
# On travis the extension should always be built
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then export TORNADO_EXTENSION=1; fi
- travis_retry python setup.py install
- export TORNADO_EXTENSION=0
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-out && sphinx-build -E -n -W -b html . sphinx-out; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-doctest-out && sphinx-build -E -n -b doctest . sphinx-out; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi
after_success:
# call codecov from project root
py3-sphinx-docs,
# Run the doctests via sphinx (which covers things not run
# in the regular test suite and vice versa)
- {py2,py3}-sphinx-doctest
+ {py2,py3}-sphinx-doctest,
+
+ py3-lint
[testenv]
# Most of these are defaults, but if you specify any you can't fall back
py2-monotonic: monotonic
sphinx: sphinx
sphinx: sphinx_rtd_theme
+ lint: flake8
setenv =
# The extension is mandatory on cpython.
setenv = TORNADO_EXTENSION=0
commands =
sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest
+
+[testenv:py3-lint]
+commands = flake8 {posargs:}
+changedir = {toxinidir}