3 ms·
Doubt it. The problem detailed at the start of the post can be solved by static analysis/linting. And no amount of new strange files will give you the same bene
by flanked-evergl 1y ago
Doubt it. The problem detailed at the start of the post can be solved by static analysis/linting. And no amount of new strange files will give you the same benefit as using some stock standard static analysis tools.
- jmmv 1y agoPlease elaborate on what those "some stock standard static analysis tools" are.
- flanked-evergl 1y agoFor python, use ruff. https://docs.astral.sh/ruff/rules/unused-import/ https://docs.astral.sh/ruff/rules/unused-import/
- jmmv 1y agoI don't think the article talks about unused dependencies anywhere, does it?
- flanked-evergl 1y agoVery first complaint is that one can't tell from imports what is being used or not. If you use a linter that removes unused imports then you can tell.
- jmmv 1y agoNo. The very first complaint is that if you don't know what is being used or not, you cannot tell whether a new "import" will add _another_ cross-module dependency that did not yet exist. As I already mentioned in another comment, you have: .../module1/__init__.py -> import module3 .../module1/foobar.py -> import module3 .../module1/baz.py -> import module2 Now you are editing or reviewing a change to foobar.py. How can you tell if depending on module2 is conceptually OK? You need to look at baz.py to prove to yourself that the dependency already exists. Or you need to know a priory that it's an OK thing to do.