Matteo
Matteo6mo ago

What's the best way to remove unused

What's the best way to remove unused imports from a notebook? Running autoflake does not work, since the imports are wrapped in a cell and the imported names are then returned by the cell, so they are "used"
1 Reply
dmad
dmad6mo ago
Not right now but see my suggestion for marimo lint: https://github.com/marimo-team/marimo/issues/1543
GitHub
marimo lint/tidy notebook.py · Issue #1543 · marimo-team/marimo
Description Discussion in #1379 brings up the great point that tools like ruff will struggle with marimo since it cannot prune imports and unused variables (since all defs are returned) Suggested s...