Skip to content

Commit

Permalink
Add a code smell test to make sure we're not using the raw system six
Browse files Browse the repository at this point in the history
(So we know we have a recent enough version)
  • Loading branch information
abadger committed Oct 16, 2015
1 parent 5d8ab9b commit 49f2b84
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/code-smell/use-compat-six.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# Do we want to check dynamic inventory, bin, etc?
BASEDIR=${1-"lib"}

SIX_USERS=$(find "$BASEDIR" -name '*.py' -exec grep -H six \{\} \;|grep import |grep -v ansible.compat)
if test -n "$SIX_USERS" ; then
printf "$SIX_USERS"
exit 1
else
exit 0
fi

0 comments on commit 49f2b84

Please sign in to comment.