Open holmanb opened 3 months ago
Aside: In the mid to near term, I don't think that it would be difficult to get this tool into a state where it can be part of CI. All that it would take (I think) is to add the ability to disable warnings inline, as well as have ignored function calls (via pyproject.toml config), then publish to PyPI. I'd prefer to have at least one co-maintainer if we go that route.
Bug report
A recent PR fixed some issues in
cc_disk_setup.py
where cloud-init was executing code during module import which would crawlPATH
for binaries - even when this module isn't used. This inspired me to write a tiny static analysis tool to help identify other code execution during import.It found more than a couple of callsites. We should resolve these issues. No all of these need to change. Assigning a partial to a global variable isn't horrid, however if it can be avoided that would be better. Running code at import time that isn't strictly needed in all cases carries unnecessary cost.