ruff/crates/ruff_macros/src
Brent Westbrook e2c5b83fe1
Inline `DiagnosticKind` into other diagnostic types (#18074)
## 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
2025-05-15 10:27:21 -04:00
..
cache_key.rs Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
combine.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
combine_options.rs Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
config.rs [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
derive_message_formats.rs Upgrade to Rust 1.86 and bump MSRV to 1.84 (#17171) 2025-04-03 15:59:44 +00:00
kebab_case.rs Inline `DiagnosticKind` into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
lib.rs Inline `DiagnosticKind` into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
map_codes.rs Inline `DiagnosticKind` into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
newtype_index.rs Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
rule_code_prefix.rs Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
rule_namespace.rs Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
violation_metadata.rs Inline `DiagnosticKind` into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00