summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-11-18 18:50:30 -0500
committerGitHub <noreply@github.com>2018-11-18 18:50:30 -0500
commita51f568a748cfc3023337aa91b67cda274ba5882 (patch)
tree26eca92cf4d620dc076e840024ff4aad60727084
parent874c126ab1e01f3e7b2ec2529b3ab7245ab96950 (diff)
parentd82578892d9c8dcd79718e14033e9173221b69d9 (diff)
downloadcmd2-git-a51f568a748cfc3023337aa91b67cda274ba5882.tar.gz
Merge pull request #600 from cclauss/patch-2
Travis CI: Use flake8 to find syntax errors and undefined names
-rw-r--r--.travis.yml11
1 files changed, 9 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 63b73ecf..e536cb34 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,7 @@ matrix:
# - BREW_INSTALL=python3
install:
- - pip install tox
+ - pip install flake8 tox
# - |
# if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
# if [[ -n "$BREW_INSTALL" ]]; then
@@ -41,7 +41,14 @@ install:
# brew install "$BREW_INSTALL"
# fi
# fi
-# pip install tox
+
+before_script:
+ # stop the build if there are Python syntax errors or undefined names
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ if [[ $TOXENV == py37 ]]; then
+ flake8 . --count --exclude=./.*,./examples,./tests --select=E901,E999,F821,F822,F823 --show-source --statistics ;
+ flake8 . --count --exclude=./.* --exit-zero --max-complexity=10 --max-line-length=127 --statistics ;
+ fi
script:
- tox