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](
|
||
|---|---|---|
| .. | ||
| cache_key.rs | ||
| combine.rs | ||
| combine_options.rs | ||
| config.rs | ||
| derive_message_formats.rs | ||
| kebab_case.rs | ||
| lib.rs | ||
| map_codes.rs | ||
| newtype_index.rs | ||
| rule_code_prefix.rs | ||
| rule_namespace.rs | ||
| rust_doc.rs | ||
| violation_metadata.rs | ||