mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 11:22:47 +00:00
Add a code smell test to make sure we're not using the raw system six
(So we know we have a recent enough version)
This commit is contained in:
12
test/code-smell/use-compat-six.sh
Executable file
12
test/code-smell/use-compat-six.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user