ruff/crates/ruff_linter
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 [flake8-pie] Omit bound tuples passed to .startswith or .endswith (#9661) 2024-01-28 19:29:04 +00:00
src Detect automagic-like assignments in notebooks (#9653) 2024-01-29 12:55:44 +00:00
__init__.py [pylint] (Re-)Implement import-private-name (C2701) (#9553) 2024-01-16 14:03:11 -05:00
Cargo.toml Bump version to v0.1.14 (#9581) 2024-01-19 12:54:39 -05:00