Skip to content
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

Fix single-cell formatting #496

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Sep 20, 2024

Summary

astral-sh/ruff#12864 changed ruff to respect the language specified in cell.metadata when determining Python cells. To do so, the PR added the new cell.metadata field and made it required as specified in the specification.

#485 patched ruff-lsp to send an empty dict for cell.metadata but we, unfortunately, missed updating the JSON for a single cell document that is used by the formatter. This PR fixes this.

Fixes astral-sh/ruff-vscode#617

Test Plan

I tested that formatting notebooks is working as expected.

@MichaReiser MichaReiser added the bug Something isn't working label Sep 20, 2024
@MichaReiser MichaReiser changed the title Fix notebook support Fix single-cell formatting Sep 20, 2024
@MichaReiser MichaReiser marked this pull request as ready for review September 20, 2024 09:35
@MichaReiser MichaReiser merged commit 780d268 into main Sep 20, 2024
20 checks passed
@MichaReiser MichaReiser deleted the micha/notebook-cell-metadata branch September 20, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken jupyter notebook cell formatting.
1 participant