From 10403efaa05fa0cefd110d5caab8fc0d513eb1af Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Fri, 18 Aug 2017 17:45:39 -0700 Subject: [PATCH] [travis] Check for code formatting problems --- .travis.yml | 7 ++++--- ci/travis.sh | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 01ff13f3e9..0afd53d5d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,10 @@ matrix: language: python python: 3.6 env: DOC_BUILD=1 + - os: linux + language: python + python: 3.6 + env: FORMATTING=1 - os: linux language: generic env: USE_PYPY_NIGHTLY=1 @@ -27,9 +31,6 @@ matrix: - os: osx language: generic env: MACPYTHON=3.6.0 - # 2017-03-07: They fixed the main bug I was hitting, so let's give it a try... - # allow_failures: - # - env: USE_PYPY_NIGHTLY=1 script: - ci/travis.sh diff --git a/ci/travis.sh b/ci/travis.sh index 7b917fdf07..a5e6378dd2 100755 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -64,6 +64,27 @@ if [ "$DOC_BUILD" = "1" ]; then # -n (nit-picky): warn on missing references # -W: turn warnings into errors sphinx-build -nW -b html source build +elif [ "$FORMATTING" = "1" ]; then + pip install -U yapf + yapf -rdp setup.py trio > formatting-fixes.patch + if [ -s formatting-fixes.patch ]; then + cat <