]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
build: Enforce flake8-cleanliness in CI
authorBen Darnell <ben@bendarnell.com>
Sat, 6 Jan 2018 23:22:41 +0000 (18:22 -0500)
committerBen Darnell <ben@bendarnell.com>
Sat, 6 Jan 2018 23:22:41 +0000 (18:22 -0500)
.flake8
.travis.yml
tox.ini

diff --git a/.flake8 b/.flake8
index be0cadde832abf2cf869b8a2c2c523043d6bbfdc..f97bdb6389855070a6cfa235c9da175a30c9fad0 100644 (file)
--- 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 ','
index df37efa50a15126158974e6d61a07b532b2e9aea..dadc4790e832ca9f8e1db10c114c79830eb7f730 100644 (file)
@@ -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 603914b5468baa404152f078e8d99d9a9473136e..c8c4b67fddeea8b01bae9c8c16abe63eaf16403d 100644 (file)
--- 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}