You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this deserves its own issue, but: Would it be possible to use extend-include = ["*.ipynb"] and ruff format to only re-format the Python code in cells, and not the ipynb file itself?
My users typically edit notebooks in Google Colab. Google Colab uses two-space indentation in the ipynb file, instead of the typical one-space indentation. ruff format currently re-indents with one space. As such, edit history becomes difficult/impossible to track, because effectively every line gets rewritten between the user saving from Google Colab (changing to 2 spaces) and CI running ruff format (changing to 1 space).
Google Colab also puts keys like metadata, nbformat, nbformat_minor at the top of the file, but ruff format moves these to the bottom. ruff format also changes the order of execution_count, outputs, etc.
I would love to be able to opt out of ipynb formatting, so that only the Python code inside cells is reformatted.
I'm not sure if this deserves its own issue, but: Would it be possible to use
extend-include = ["*.ipynb"]
andruff format
to only re-format the Python code in cells, and not the ipynb file itself?My users typically edit notebooks in Google Colab. Google Colab uses two-space indentation in the ipynb file, instead of the typical one-space indentation.
ruff format
currently re-indents with one space. As such, edit history becomes difficult/impossible to track, because effectively every line gets rewritten between the user saving from Google Colab (changing to 2 spaces) and CI runningruff format
(changing to 1 space).Google Colab also puts keys like metadata, nbformat, nbformat_minor at the top of the file, but
ruff format
moves these to the bottom.ruff format
also changes the order ofexecution_count
,outputs
, etc.I would love to be able to opt out of ipynb formatting, so that only the Python code inside cells is reformatted.
Originally posted by @jpmckinney in #5188 (comment)
The text was updated successfully, but these errors were encountered: