-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Create ruff_notebook
crate
#7039
Conversation
612ca3b
to
594a355
Compare
594a355
to
40aa4ef
Compare
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.
I don't have a better recommendation but moving source map to diagnostic feels a bit off because it isn't the only possible use case for source maps. For example, source maps can be used to move the IDE cursor to the right position after applying fixes. However, that requires extracting our fix infrastructure which is rather involved and even Fix
is defined in Diagnostic
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
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.
That was quick, thanks!
We might want to name it something along the lines of ruff_notebook
as Jupyter is actually just a frontend while this crate would ideally handle notebooks in general (#6140)
40aa4ef
to
adc03d1
Compare
adc03d1
to
cb40b62
Compare
Summary
This PR moves
ruff/jupyter
into its ownruff_notebook
crate. Beyond the move itself, there were a few challenges:ruff_notebook
relies on the source map abstraction. I've moved the source map intoruff_diagnostics
, since it doesn't have any dependencies on its own and is used alongside diagnostics.ruff_notebook
has a couple tests for end-to-end linting and autofixing. I had to leave these tests inruff
itself.ruff/jupyter
that relied on Python lexing, in order to provide a more targeted error message in the event that a user saves a.py
file with a.ipynb
extension. I removed this in order to avoid a dependency on the parser, it felt like it wasn't worth retaining just for that dependency.Test Plan
cargo test