-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
coreRelated to core functionalityRelated to core functionalityhelp wantedContributions especially welcomeContributions especially welcome
Description
black supports formatting jupyter notebook with the jupyter extra black[jupyter]. If installed like this, it formats jupyter notebooks just like python files. It would be nice if ruff could similarly lint and fix jupyter notebooks.
Steps to implement this:
- Read Jupyter notebooks, build a mapping between cells and concatenated code and and print lint errors with cell ids. The code is in jupyter/notebooks.rs.
- Apply fixes to concatenated code and map back to cells
- Write back jupyter notebooks ensuring that if there are no changes the json is identical (roundtrip support). You might need to extend or replace the current schema or drop some of the schema for just
serde_json::Value. See also the black implementation. - Test roundtrip support with a bunch of different notebooks found in the wild, ideally from different generators (e.g. jupyter notebook and pycharm) and different schema versions.
- Remove
jupyter_notebookfeature and include.ipynbfiles in ruff by default - Optional: Check if there a any lints that should be off for jupyter notebook, e.g. "no print" or isort rules might not make sense
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreRelated to core functionalityRelated to core functionalityhelp wantedContributions especially welcomeContributions especially welcome