mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Enhance empty __init__ code-smell to check module_utils (#33438)
Empty __init__ will allow us to use python namespaces with all of these files. That may be something we want to take advantage of for allowign them to be expanded by user dirs. Also might be needed for AnsiballZ or other wrapper enhancements in the future.
This commit is contained in:
parent
8e6ebae8bd
commit
7bd0af15d2
3 changed files with 9 additions and 23 deletions
|
@ -2,8 +2,11 @@
|
|||
|
||||
found=''
|
||||
|
||||
for path in lib/ansible/modules/ test/units/; do
|
||||
files=$(find "${path}" -name __init__.py -size '+0')
|
||||
for path in lib/ansible/modules/ lib/ansible/module_utils test/units/; do
|
||||
# facts is grandfathered in but will break namespacing. Only way to fix it
|
||||
# is to deprecate and eventually remove.
|
||||
# six will break namespacing but because it is bundled we should not be overriding it
|
||||
files=$(find "${path}" -name __init__.py -size '+0' | sed '\!lib/ansible/module_utils/\(six\|facts\)/__init__.py!d')
|
||||
|
||||
if [ "${files}" ]; then
|
||||
echo "${files}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue