mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-12 22:58:22 +00:00
Use Display
for formatter parse errors (#9316)
## Summary This helps a bit with (but does not close) the issues described in https://github.com/astral-sh/ruff/issues/9311. E.g., now, we at least see: `error: Failed to format main.py: source contains syntax errors: invalid syntax. Got unexpected token '=' at byte offset 20`.
This commit is contained in:
parent
2895e7d126
commit
97e9d3c54f
5 changed files with 57 additions and 8 deletions
|
@ -108,9 +108,9 @@ where
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum FormatModuleError {
|
||||
#[error("source contains syntax errors: {0:?}")]
|
||||
#[error("source contains syntax errors: {0}")]
|
||||
LexError(LexicalError),
|
||||
#[error("source contains syntax errors: {0:?}")]
|
||||
#[error("source contains syntax errors: {0}")]
|
||||
ParseError(ParseError),
|
||||
#[error(transparent)]
|
||||
FormatError(#[from] FormatError),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue