mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00

## 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
27 lines
633 B
TOML
27 lines
633 B
TOML
[package]
|
|
name = "ruff_macros"
|
|
version = "0.0.0"
|
|
publish = false
|
|
authors = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
homepage = { workspace = true }
|
|
documentation = { workspace = true }
|
|
repository = { workspace = true }
|
|
license = { workspace = true }
|
|
|
|
[lib]
|
|
proc-macro = true
|
|
doctest = false
|
|
|
|
[dependencies]
|
|
ruff_python_trivia = { workspace = true }
|
|
|
|
heck = { workspace = true }
|
|
proc-macro2 = { workspace = true }
|
|
quote = { workspace = true }
|
|
syn = { workspace = true, features = ["derive", "parsing", "extra-traits", "full"] }
|
|
itertools = { workspace = true }
|
|
|
|
[lints]
|
|
workspace = true
|