Skip to content

Commit

Permalink
create flake8 config, update travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Apr 26, 2020
1 parent 023e8ce commit be87e0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .flake8
@@ -0,0 +1,8 @@
[flake8]
# Ignore list taken from https://github.com/psf/black/blob/master/.flake8
# E203 Whitespace before ':'
# E266 Too many leading '#' for block comment
# E501 Line too long (82 > 79 characters)
# W503 Line break occurred before a binary operator
ignore = E203, E266, E501, W503
exclude = docs, build
10 changes: 3 additions & 7 deletions .travis.yml
@@ -1,6 +1,5 @@
dist: xenial
language: python
sudo: false
os:
- linux
cache:
Expand All @@ -13,15 +12,12 @@ python:
install:
- pip install codecov
- pip install .[dev]
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install -U black; fi
- if [[ $TRAVIS_PYTHON_VERSION != 3.5 ]]; then pip install -U black; fi
script:
- export PYTHONPATH=$PYTHONPATH:$(pwd)
# * E501 - line length limit
# * E123 - indentation on data structures
# * W504 - line break after binary operator
- flake8 . --ignore=F403,E501,E123,E128,W504,W503 --exclude=docs,build
- flake8 .
- py.test --cov=mesa tests/ --cov-report=xml
- if [ $PYTHON == "3.6" ];
- if [ $PYTHON != "3.5" ];
then black --check --exclude=mesa/cookiecutter-mesa/* .;
fi
# - ./tests/test_end_to_end_viz.sh # needs to be investigated on why this took forever
Expand Down
2 changes: 1 addition & 1 deletion mesa/agent.py
Expand Up @@ -13,7 +13,7 @@
class Agent:
""" Base class for a model agent. """

def __init__(self, unique_id: int, model: Model) -> None:
def __init__(self, unique_id: int, model: Model) -> None:
""" Create a new agent. """
self.unique_id = unique_id
self.model = model
Expand Down

0 comments on commit be87e0a

Please sign in to comment.