mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
Add row and column numbers to formatted parse errors (#9321)
## Summary We now render parse errors in the formatter identically to those in the linter, e.g.: ``` ❯ cargo run -p ruff_cli -- format foo.py error: Failed to parse foo.py:1:17: Unexpected token '=' ``` Closes https://github.com/astral-sh/ruff/issues/8338. Closes https://github.com/astral-sh/ruff/issues/9311.
This commit is contained in:
parent
e80260a3c5
commit
48e04cc2c8
9 changed files with 88 additions and 59 deletions
|
@ -339,7 +339,7 @@ pub fn add_noqa_to_path(
|
|||
if let Some(error) = error {
|
||||
error!(
|
||||
"{}",
|
||||
DisplayParseError::new(error, locator.to_source_code(), source_kind, path)
|
||||
DisplayParseError::new(&error, &locator.to_source_code(), source_kind, Some(path))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue