mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 03:18:38 +00:00
## Summary This PR updates the logic for `is_magic_cell` to include certain cell magics. These cell magics would contain Python code following the line defining the command. The code could define a variable which can then be referenced in other cells. Currently, we would ignore the cell completely leading to undefined-name violation. As discussed in https://github.com/astral-sh/ruff/issues/8354#issuecomment-1832221009 ## Test Plan Add new test case to validate this scenario. |
||
|---|---|---|
| .. | ||
| cell | ||
| add_missing_cell_id.ipynb | ||
| after_fix.ipynb | ||
| before_fix.ipynb | ||
| invalid_extension.ipynb | ||
| ipy_escape_command.ipynb | ||
| ipy_escape_command_expected.ipynb | ||
| isort.ipynb | ||
| isort_expected.ipynb | ||
| no_cell_id.ipynb | ||
| no_trailing_newline.ipynb | ||
| not_json.ipynb | ||
| R.ipynb | ||
| unused_variable.ipynb | ||
| unused_variable_expected.ipynb | ||
| valid.ipynb | ||
| wrong_schema.ipynb | ||