Skip to content

Commit a51f568

Browse files
authored
Merge pull request #600 from cclauss/patch-2
Travis CI: Use flake8 to find syntax errors and undefined names
2 parents 874c126 + d825788 commit a51f568

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.travis.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,22 @@ matrix:
3333
# - BREW_INSTALL=python3
3434

3535
install:
36-
- pip install tox
36+
- pip install flake8 tox
3737
# - |
3838
# if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
3939
# if [[ -n "$BREW_INSTALL" ]]; then
4040
# brew update
4141
# brew install "$BREW_INSTALL"
4242
# fi
4343
# fi
44-
# pip install tox
44+
45+
before_script:
46+
# stop the build if there are Python syntax errors or undefined names
47+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
48+
if [[ $TOXENV == py37 ]]; then
49+
flake8 . --count --exclude=./.*,./examples,./tests --select=E901,E999,F821,F822,F823 --show-source --statistics ;
50+
flake8 . --count --exclude=./.* --exit-zero --max-complexity=10 --max-line-length=127 --statistics ;
51+
fi
4552

4653
script:
4754
- tox

0 commit comments

Comments
 (0)