]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
ci: Enforce black format
authorBen Darnell <ben@bendarnell.com>
Sun, 7 Oct 2018 03:07:57 +0000 (23:07 -0400)
committerBen Darnell <ben@bendarnell.com>
Sun, 7 Oct 2018 03:07:57 +0000 (23:07 -0400)
.travis.yml
tox.ini

index 3a5d4accd579e37ba33dd4551a089924e0c8143c..6dd58ddd300dacb0ef4075cdbf54da2bf37bb305 100644 (file)
@@ -48,7 +48,7 @@ install:
     # version supported. But Python 3.7 requires slower-to-start VMs,
     # so we run it on 3.6 to minimize total CI run time.
     - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install -r docs/requirements.txt; fi
-    - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install flake8 mypy==0.630; fi
+    - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install flake8 mypy==0.630 black; 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
@@ -94,6 +94,7 @@ script:
     - 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 == 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 (cd .. && flake8); fi
+    - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then (cd .. && black --check --diff tornado); fi
     - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then (cd .. && mypy tornado); fi
 
 after_success:
diff --git a/tox.ini b/tox.ini
index f43ac4fa1501679a32eb09289e37612b0b686b05..03d4d040df39a353164a12174e8bfa625fb4bf5d 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -63,6 +63,8 @@ deps =
      {py3,py35,py36,py37}-full: pycares
      sphinx: -r{toxinidir}/docs/requirements.txt
      lint: flake8
+     lint: black
+     mypy: mypy==0.630
 
 setenv =
        # The extension is mandatory on cpython.
@@ -123,10 +125,11 @@ commands =
      sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest
 
 [testenv:py3-lint]
-commands = flake8 {posargs:}
+commands =
+         flake8 {posargs:}
+         black --check --diff {posargs:tornado}
 changedir = {toxinidir}
 
 [testenv:py3-mypy]
 commands = mypy {posargs:tornado}
 changedir = {toxinidir}
-deps = mypy==0.630