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 8db7aba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Expand Up @@ -3,14 +3,20 @@
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
- '[ -z "$TRAVIS_COMMIT_RANGE" ] || git diff $TRAVIS_COMMIT_RANGE | flake8 --diff'
# Or if we are just on a branch, work out what we've changed since we branched off master
- '[ -n "$TRAVIS_COMMIT_RANGE" ] || git diff origin/master... | flake8 --diff'

# 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 8db7aba

Please sign in to comment.