-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add auto-fix for multiple definctions and popular imports #3343
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
tf: "import tensorflow as tf", | ||
torch: "import torch", | ||
xr: "import xarray as xr", | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably consolidate this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! I played with it, and it works well. Just one comment on formatting.
...indentLines(linesBeforeLastStmt, indentation), | ||
`${indentation}return ${linesRest[0]}`, | ||
...indentLines(linesRest.slice(1), indentation), | ||
"_()", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you insert two blank lines before _()
? To make it roughly match what ruff format would generate.
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.10.10-dev21 |
Part of #3110
This adds two autofixes for different marimo errors. This opens the door for more autofixes as well. Right now this happens on all the frontend because 1) the code transformations are not that difficult and 2) still requires frontend logic like focusing the editor or adding a new cell. We could move some of this to the backend but would prefer to put the auto-fixes into a a proper linting framework + LSP.
The autofixes: