Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Travis CI: run flake8 tests to find syntax errors and undefined names
__E901,E999,F821,F822,F823__ are the "_showstopper_" [flake8](http://flake8.pycqa.org) 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
  • Loading branch information
cclauss committed Nov 28, 2018
1 parent 48a21cf commit 49703d0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .travis.yml
@@ -0,0 +1,21 @@
group: travis_latest
language: python
cache: pip
matrix:
include:
- python: 3.7
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
sudo: required # required for Python >= 3.7 (travis-ci/travis-ci#9069)
install:
# - pip install -r requirements.txt
- pip install flake8
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- true # add other tests here
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down

0 comments on commit 49703d0

Please sign in to comment.