mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 23:24:31 -05:00
Formatter: Fix syntax error location in notebooks (#16499)
## Summary Fixes https://github.com/astral-sh/ruff/issues/16476 fixes: #11453 We format notebooks cell by cell. That means, that offsets in parse errors are relative to the cell and not the entire document. We didn't account for this fact when emitting syntax errors for notebooks in the formatter. This PR ensures that we correctly offset parse errors by the cell location. ## Test Plan Added test (it panicked before)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -2693,6 +2693,7 @@ dependencies = [
|
||||
"ruff_notebook",
|
||||
"ruff_python_ast",
|
||||
"ruff_python_formatter",
|
||||
"ruff_python_parser",
|
||||
"ruff_server",
|
||||
"ruff_source_file",
|
||||
"ruff_text_size",
|
||||
|
||||
Reference in New Issue
Block a user