ansible/test/sanity/code-smell/no-basestring.sh
Matt Clay 912d6ed8cc Clean up code-smell sanity scripts. (#18407)
- Replace find ';' with '+' for faster execution.
- Replace grep -R with -r to avoid recursive warnings.
- Exclude .git and .tox directories from recursive grep.
- Improve messaging on failed sanity checks.
- Add no-basestring check to Shippable.
2016-11-07 16:46:33 -08:00

18 lines
401 B
Bash
Executable file

#!/bin/sh
BASESTRING_USERS=$(grep -r basestring . \
--exclude-dir .git \
--exclude-dir .tox \
| grep isinstance \
| grep -v \
-e lib/ansible/compat/six/_six.py \
-e lib/ansible/module_utils/six.py \
-e lib/ansible/modules/core/ \
-e lib/ansible/modules/extras/ \
-e '^[^:]*:#'
)
if [ "${BASESTRING_USERS}" ]; then
echo "${BASESTRING_USERS}"
exit 1
fi