Skip to content

Travis CI: Run flake8 tests to find syntax errors and undefined names #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
sudo: false
language: python
cache: pip
python:
- "3.6"
- "3.5"
- "3.4"
- "3.3"
- "2.7"
- "2.6"

sudo: false

# command to install dependencies, e.g. pip install -r requirements.txt
# These packages only exist on Ubuntu 13.04 and newer:
# No dependencies currently unless using Python 2.6.
matrix:
include:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
- 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:
- if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install -r requirements_py26.txt; fi
- python setup.py install

before_script:
# Run flake8 tests only on Python 2.7 and 3.7...
# 1) stop the build if there are Python syntax errors or undefined names
# 2) exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- if [[ $TRAVIS_PYTHON_VERSION == *.7 ]]; then
pip install flake8;
flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics;
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics;
fi

# command to run tests, e.g. python setup.py test

script:
Expand Down