ruff/crates/ruff_diagnostics/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
..
diagnostic.rs Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
edit.rs Upgrade Rust toolchain to 1.83 (#14677) 2024-11-29 12:05:05 +00:00
fix.rs Document comment policy around fix safety (#14300) 2024-11-13 08:03:58 -05:00
lib.rs Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
source_map.rs Enable formatting for Jupyter notebooks (#7749) 2023-10-02 14:44:18 +00:00
violation.rs Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00