ruff/crates/ruff_macros/src
Brent Westbrook d6009eb942
Unify Message variants (#18051)
## Summary

This PR unifies the ruff `Message` enum variants for syntax errors and
rule violations into a single `Message` struct consisting of a shared
`db::Diagnostic` and some additional, optional fields used for some rule
violations.

This version of `Message` is nearly a drop-in replacement for
`ruff_diagnostics::Diagnostic`, which is the next step I have in mind
for the refactor.

I think this is also a useful checkpoint because we could possibly add
some of these optional fields to the new `Diagnostic` type. I think
we've previously discussed wanting support for `Fix`es, but the other
fields seem less relevant, so we may just need to preserve the `Message`
wrapper for a bit longer.

## Test plan

Existing tests

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-19 13:34:04 -04:00
..
cache_key.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +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 Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
derive_message_formats.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
kebab_case.rs Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
lib.rs Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
map_codes.rs Unify Message variants (#18051) 2025-05-19 13:34:04 -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