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
Closes #3792.
This is a draft PR tracking the development of Ruff's support for Markdown. I'm opening it now to get feedback from maintainers on if the proposed design makes sense.
The next step will involve changing
lint_path
and subsequent calls to work overstr
slices. Python/Jupyter notebooks will always be slices of length 1 - Markdown code blocks will be variable length. We can't concatenate the Markdown source code since the code blocks are independent, unlike Jupyter code blocks. I'd like to get the design solidified before I undertake that work.There are still some abstractions that could be made, like converting our Jupyter implementation's mapping over to a CodeBlock-based one, as well as standardizing an interface for parsing files that don't solely contain Python. Same as above - I'd like to align on an initial CodeBlock design first, since that will likely be foundational to future embedded-language tasks.
Test Plan