ruff/crates/ruff_notebook
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
..
resources/test/fixtures/jupyter Detect automagic-like assignments in notebooks (#9653) 2024-01-29 12:55:44 +00:00
src Detect automagic-like assignments in notebooks (#9653) 2024-01-29 12:55:44 +00:00
Cargo.toml Generate deterministic ids when formatting notebooks (#9359) 2024-01-04 09:19:00 -06:00