ruff/crates/ruff
Brent Westbrook 96b60c11d9
Respect `--output-format` with `--watch` (#21097)
Summary
--

Fixes #19550

This PR copies our non-watch diagnostic rendering code into
`Printer::write_continuously` in preview mode, allowing it to use
whatever output format is passed in.

I initially marked this as also fixing #19552, but I guess that's not
true currently but will be true once this is stabilized and we can
remove the warning.

Test Plan
--

Existing tests, but I don't think we have any `watch` tests, so some
manual testing as well. The default with just `ruff check --watch` is
still `concise`, adding just `--preview` still gives the `full` output,
and then specifying any other output format works, with JSON as one
example:

<img width="695" height="719" alt="Screenshot 2025-10-27 at 9 21 41 AM"
src="https://github.com/user-attachments/assets/98957911-d216-4fc4-8b6c-22c56c963b3f"
/>
2025-10-27 12:04:55 -04:00
..
resources/test/fixtures Rename `ruff_cli` crate to `ruff` (#9557) 2024-01-16 17:47:01 -05:00
src Respect `--output-format` with `--watch` (#21097) 2025-10-27 12:04:55 -04:00
tests Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
Cargo.toml Bump 0.14.2 (#21051) 2025-10-23 15:17:22 -04:00
build.rs Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00