mirror of https://github.com/astral-sh/ruff
## Summary This PR deletes the `DiagnosticKind` type by inlining its three fields (`name`, `body`, and `suggestion`) into three other diagnostic types: `Diagnostic`, `DiagnosticMessage`, and `CacheMessage`. Instead of deferring to an internal `DiagnosticKind`, both `Diagnostic` and `DiagnosticMessage` now have their own macro-generated `AsRule` implementations. This should make both https://github.com/astral-sh/ruff/pull/18051 and another follow-up PR changing the type of `name` on `CacheMessage` easier since its type will be able to change separately from `Diagnostic` and `DiagnosticMessage`. ## Test Plan Existing tests |
||
|---|---|---|
| .. | ||
| 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 | ||
| violation_metadata.rs | ||