2017-05-25 00:59:59 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-05-31 18:54:20 +02:00
|
|
|
CMP_USERS=$(grep -rI ' cmp[^a-zA-Z0-9_:=]' . \
|
2017-05-25 00:59:59 +02:00
|
|
|
--exclude-dir .tox \
|
|
|
|
| grep -v \
|
|
|
|
-e lib/ansible/module_utils/six/_six.py \
|
2017-07-03 21:15:38 +02:00
|
|
|
-e .git \
|
2017-07-14 15:24:45 +02:00
|
|
|
-e docs/docsite/_build/ \
|
|
|
|
-e docs/docsite/rst/dev_guide/testing/sanity/ \
|
2017-05-25 00:59:59 +02:00
|
|
|
-e test/sanity/code-smell/no-list-cmp.sh
|
|
|
|
)
|
|
|
|
|
|
|
|
if [ "${CMP_USERS}" ]; then
|
|
|
|
echo 'cmp has been removed in python3. Alternatives:'
|
|
|
|
echo ' http://python3porting.com/preparing.html#when-sorting-use-key-instead-of-cmp'
|
|
|
|
echo "${CMP_USERS}"
|
|
|
|
exit 1
|
|
|
|
fi
|