mirror of https://github.com/astral-sh/ruff
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](
|
||
|---|---|---|
| .. | ||
| ruff_fix_validity.rs | ||
| ruff_formatter_idempotency.rs | ||
| ruff_formatter_validity.rs | ||
| ruff_parse_idempotency.rs | ||
| ruff_parse_simple.rs | ||
| ty_check_invalid_syntax.rs | ||