ruff/crates/ruff
Brent Westbrook 4b0fa5f270
Render a diagnostic for syntax errors introduced in formatter tests (#21021)
## Summary

I spun this out from #21005 because I thought it might be helpful
separately. It just renders a nice `Diagnostic` for syntax errors
pointing to the source of the error. This seemed a bit more helpful to
me than just the byte offset when working on #21005, and we had most of
the code around after #20443 anyway.

## Test Plan

This doesn't actually affect any passing tests, but here's an example of
the additional output I got when I broke the spacing after the `in`
token:

```
    error[internal-error]: Expected 'in', found name
      --> /home/brent/astral/ruff/crates/ruff_python_formatter/resources/test/fixtures/black/cases/cantfit.py:50:79
       |
    48 |     need_more_to_make_the_line_long_enough,
    49 | )
    50 | del ([], name_1, name_2), [(), [], name_4, name_3], name_1[[name_2 for name_1 inname_0]]
       |                                                                               ^^^^^^^^
    51 | del ()
       |
```

I just appended this to the other existing output for now.
2025-10-21 13:47:26 -04:00
..
resources/test/fixtures Rename ruff_cli crate to ruff (#9557) 2024-01-16 17:47:01 -05:00
src Render a diagnostic for syntax errors introduced in formatter tests (#21021) 2025-10-21 13:47:26 -04:00
tests feat: 'ruff rule' provides more easily parsable JSON ouput (#20168) 2025-10-20 09:09:51 +02:00
build.rs Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
Cargo.toml Bump 0.14.1 (#20925) 2025-10-16 12:44:13 -05:00