summaryrefslogtreecommitdiffstats
path: root/.travis.yml
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-02-14 23:10:41 +0100
committerBrian May <brian@linuxpenguins.xyz>2018-02-22 18:02:36 +1100
commitd11f5b9d16e1d5b30c63a1bf2801c459492cf6e4 (patch)
treea387dc2a70dcd1be733fccb865d914f29e4aa908 /.travis.yml
parent93b969a049983dcac0c659c015ab7e09660ed825 (diff)
Use flake8 to find Python syntax errors or undefined names
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml8
1 files changed, 7 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 28e7a80..6fbfaa2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,13 @@ python:
- pypy
install:
- - travis_retry pip install -q pytest mock
+ - travis_retry pip install -q flake8 pytest mock
+
+before_script:
+ # stop the build if there are Python syntax errors or undefined names.
+ - if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics; fi
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide.
+ - if [[ $TRAVIS_PYTHON_VERSION != '2.6' ]]; then flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics; fi
script:
- PYTHONPATH=. py.test