Skip to content

Commit c3359ad

Browse files
author
cclauss
authored
Travis CI: Run flake8 tests to find Python syntax errors and undefined names
Add [flake8](http://flake8.pycqa.org) tests to find Python syntax errors and undefined names. __E901,E999,F821,F822,F823__ are the "_showstopper_" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety. * F821: undefined name `name` * F822: undefined name `name` in `__all__` * F823: local variable name referenced before assignment * E901: SyntaxError or IndentationError * E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree
1 parent 5b391fe commit c3359ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
language: python
22
python:
33
- "2.7"
4-
- "3.2"
5-
- "3.3"
64
- "3.4"
75
- "3.5"
6+
- "3.6"
7+
before_script:
8+
- pip install flake8
9+
# stop the build if there are Python syntax errors or undefined names
10+
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
11+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
12+
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
813
script:
914
- python setup.py test

0 commit comments

Comments
 (0)