mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-15 02:11:58 +00:00
## 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` |
||
|---|---|---|
| .. | ||
| automagic.json | ||
| automagic_after_code.json | ||
| automagic_assignment.json | ||
| automagic_before_code.json | ||
| automagics.json | ||
| cell_magic.json | ||
| code_and_magic.json | ||
| markdown.json | ||
| only_code.json | ||
| only_magic.json | ||
| unicode_magic_gh9145.json | ||
| valid_cell_magic.json | ||