ruff/fuzz/fuzz_targets
Brent Westbrook 10a1d9f01e
Unify `OldDiagnostic` and `Message` (#18391)
Summary
--

This PR unifies the remaining differences between `OldDiagnostic` and
`Message` (`OldDiagnostic` was only missing an optional `noqa_offset`
field) and
replaces `Message` with `OldDiagnostic`.

The biggest functional difference is that the combined `OldDiagnostic`
kind no
longer implements `AsRule` for an infallible conversion to `Rule`. This
was
pretty easy to work around with `is_some_and` and `is_none_or` in the
few places
it was needed. In `LintContext::report_diagnostic_if_enabled` we can
just use
the new `Violation::rule` method, which takes care of most cases.

Most of the interesting changes are in [this
range](8156992540)
before I started renaming.

Test Plan
--

Existing tests

Future Work
--

I think it's time to start shifting some of these fields to the new
`Diagnostic`
kind. I believe we want `Fix` for sure, but I'm less sure about the
others. We
may want to keep a thin wrapper type here anyway to implement a `rule`
method,
so we could leave some of these fields on that too.
2025-06-19 09:37:58 -04:00
..
ruff_fix_validity.rs Introduce `LinterSettings` 2023-09-20 17:02:34 +02:00
ruff_formatter_idempotency.rs Add a idempotent fuzz_target for ruff_python_formatter (#9448) 2024-01-11 08:55:59 +01:00
ruff_formatter_validity.rs Unify `OldDiagnostic` and `Message` (#18391) 2025-06-19 09:37:58 -04:00
ruff_parse_idempotency.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00
ruff_parse_simple.rs Extract `LineIndex` independent methods from `Locator` (#13938) 2024-10-28 07:53:41 +00:00
ty_check_invalid_syntax.rs [ty] Allow overriding rules for specific files (#18648) 2025-06-15 14:27:39 +01:00