From: Ben Darnell Date: Sat, 6 Jan 2018 23:22:41 +0000 (-0500) Subject: build: Enforce flake8-cleanliness in CI X-Git-Tag: v5.0.0~19^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7a7026c8b189d240b2452f0d9ef069df93dcc19;p=thirdparty%2Ftornado.git build: Enforce flake8-cleanliness in CI --- diff --git a/.flake8 b/.flake8 index be0cadde8..f97bdb638 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] -exclude = .git,.tox,__pycache__ +exclude = .git,.tox,__pycache__,.eggs,build max-line-length = 100 ignore = # E231 missing whitespace after ',' diff --git a/.travis.yml b/.travis.yml index df37efa50..dadc4790e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ install: # 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 @@ -77,6 +78,7 @@ script: - 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 diff --git a/tox.ini b/tox.ini index 603914b54..c8c4b67fd 100644 --- a/tox.ini +++ b/tox.ini @@ -44,7 +44,9 @@ envlist = 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 @@ -79,6 +81,7 @@ deps = py2-monotonic: monotonic sphinx: sphinx sphinx: sphinx_rtd_theme + lint: flake8 setenv = # The extension is mandatory on cpython. @@ -151,3 +154,7 @@ changedir = docs setenv = TORNADO_EXTENSION=0 commands = sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest + +[testenv:py3-lint] +commands = flake8 {posargs:} +changedir = {toxinidir}