Skip to content

Commit

Permalink
adding pep8 test to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekkumac committed Sep 29, 2016
1 parent 9d3bd82 commit 5d00c49
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ install:

script:
- nosetests -c .noserc autocertkit/tests/ acktools/
- tools/checkpep8.sh

after_success:
- coveralls
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
paramiko
coveralls
autopep8
17 changes: 8 additions & 9 deletions tools/autopep8.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/bin/sh
if [ $# -eq 0 ]
then
echo "Automated extra/missing whitespace code correction using autopep8"
files=`find ../ -not -path "../XenAPI/*" |
egrep -e '\.(py)$$' -e 'plugins/autocertkit' |
sort | uniq`
pwd0="$(dirname "$0")"
if [ $# -eq 0 ] ; then
echo "Automated extra/missing whitespace code correction using autopep8"
files=`find $pwd0/../ -not -path "$pwd0/../XenAPI/*" |
egrep -e '\.(py)$$' -e 'plugins/autocertkit' |
sort | uniq`
else
files="$1"
files="$1"
fi

for file in $files
do
for file in $files ; do
echo "Running autopep8 on $file for whitespace changes only..."
autopep8 -i $file
done
11 changes: 11 additions & 0 deletions tools/checkpep8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
pwd0="$(dirname "$0")"
$pwd0/autopep8.sh
if [ "$(git diff)" ]] ; then
echo "checkpep8: Found violations, use tools/autopep8.sh to fix."
echo "checkpep8: Expected fix:-"
git diff
exit 1
else
echo "checkpep8: No violations found. Success"
fi

0 comments on commit 5d00c49

Please sign in to comment.