ruff/crates/ruff_notebook/resources/test/fixtures/jupyter
Charlie Marsh bea8f2ee3a
Detect automagic-like assignments in notebooks (#9653)
## Summary

Given a statement like `colors = 6`, we currently treat the cell as an
automagic (since `colors` is an automagic) -- i.e., we assume it's
equivalent to `%colors = 6`. This PR adds some additional detection
whereby if the statement is an _assignment_, we avoid treating it as
such. I audited the list of automagics, and I believe this is safe for
all of them.

Closes https://github.com/astral-sh/ruff/issues/8526.

Closes https://github.com/astral-sh/ruff/issues/9648.

## Test Plan

`cargo test`
2024-01-29 12:55:44 +00:00
..
cell Detect automagic-like assignments in notebooks (#9653) 2024-01-29 12:55:44 +00:00
add_missing_cell_id.ipynb
after_fix.ipynb
before_fix.ipynb
invalid_extension.ipynb
ipy_escape_command.ipynb Allow transparent cell magics (#8911) 2023-12-07 14:15:43 -06:00
ipy_escape_command_expected.ipynb Allow transparent cell magics (#8911) 2023-12-07 14:15:43 -06:00
isort.ipynb
isort_expected.ipynb
no_cell_id.ipynb
no_trailing_newline.ipynb
not_json.ipynb
R.ipynb
undefined_name.ipynb Detect automagic-like assignments in notebooks (#9653) 2024-01-29 12:55:44 +00:00
unused_variable.ipynb
unused_variable_expected.ipynb
valid.ipynb
wrong_schema.ipynb