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
If you run, e.g., cat Untitled.ipynb | cargo run -p ruff_cli -- check --stdin-filename Untitled.ipynb -n --fix, then the content we write to stdout is the fixed source code. Writing this back to the notebook will leave you with an invalid notebook! Instead, we need to write back the entire JSON structure, including the fixed content.
The text was updated successfully, but these errors were encountered:
## Summary
When writing back notebooks via `stdout`, we need to write back the
entire JSON content, not _just_ the fixed source code. Otherwise,
writing the output _back_ to the file will yield an invalid notebook.
Closes#7747
## Test Plan
`cargo test`
If you run, e.g.,
cat Untitled.ipynb | cargo run -p ruff_cli -- check --stdin-filename Untitled.ipynb -n --fix
, then the content we write tostdout
is the fixed source code. Writing this back to the notebook will leave you with an invalid notebook! Instead, we need to write back the entire JSON structure, including the fixed content.The text was updated successfully, but these errors were encountered: