Merged
Conversation
612ca3b to
594a355
Compare
594a355 to
40aa4ef
Compare
MichaReiser
approved these changes
Sep 1, 2023
Member
There was a problem hiding this comment.
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
Contributor
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
dhruvmanila
approved these changes
Sep 1, 2023
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR moves
ruff/jupyterinto its ownruff_notebookcrate. Beyond the move itself, there were a few challenges:ruff_notebookrelies 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_notebookhas a couple tests for end-to-end linting and autofixing. I had to leave these tests inruffitself.ruff/jupyterthat relied on Python lexing, in order to provide a more targeted error message in the event that a user saves a.pyfile with a.ipynbextension. 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