Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Enforce PEP8 on any changed hunks.
Browse files Browse the repository at this point in the history
An enforcable stlye guide is a good thing - we have some developers who
are less experienced with python so being able to say 'do it this way'
is a good thing.

I am open to disabling some more rules (for instance I have set line
lengths to 160 up from the default 79) but not the enforcement of a
style.

This change means that we don't have to fix PEP8 style violations in one
big go, and can still get useful automated style checking.
  • Loading branch information
ashb committed Apr 17, 2015
1 parent e829a86 commit 33c5f73
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .travis.yml
Expand Up @@ -3,14 +3,26 @@
language: python

install:
- pip install coveralls
- pip install coveralls flake8

python:
- "2.7"

# command to install dependencies and run tests
script:
coverage run --source=bootstrap_cfn setup.py test
script:
# If we are a Pull request, check the changes introduced in it for pep8
#
# Or if we are just on a branch, work out what we've changed since we
# branched off master
- |
set -e -x -o pipefail;
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
then git diff $TRAVIS_COMMIT_RANGE | flake8 --diff;
else git fetch origin master:origin/master > /dev/null && git diff origin/master... | flake8 --diff
fi
# Then run the tests
- coverage run --source=bootstrap_cfn setup.py test

after_success:
coveralls
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
@@ -0,0 +1,2 @@
[flake8]
max-line-length=160

0 comments on commit 33c5f73

Please sign in to comment.