ruff/crates
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
..
ruff Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_annotate_snippets ruff_annotate_snippets: address unused code warnings 2025-04-07 08:24:08 -04:00
ruff_benchmark [ty] Add benchmark for union of tuples (#18076) 2025-05-13 22:14:30 +02:00
ruff_cache Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_db [ty] Change layout of extra verbose output and respect --color for verbose output (#18089) 2025-05-15 09:57:59 +02:00
ruff_dev [ty] fix missing '>' in HTML anchor tags in CLI reference (#18096) 2025-05-14 15:50:35 +00:00
ruff_diagnostics Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_formatter Fix typos (#17988) 2025-05-09 14:57:14 -04:00
ruff_graph [ty] Update salsa (#17964) 2025-05-09 11:54:07 +02:00
ruff_index Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_linter Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_macros Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_notebook Split SourceLocation into LineColumn and SourceLocation (#17587) 2025-04-27 11:27:33 +01:00
ruff_options_metadata [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ruff_python_ast [ruff_python_ast] Fix redundant visitation of test expressions in elif clause statements (#18064) 2025-05-13 07:10:23 +00:00
ruff_python_ast_integration_tests Visit Identifier node as part of the SourceOrderVisitor (#17110) 2025-04-01 16:58:09 +02:00
ruff_python_codegen Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_formatter Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_index Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_literal Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_parser Fix typos (#17988) 2025-05-09 14:57:14 -04:00
ruff_python_resolver Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_semantic [isort] Check full module path against project root(s) when categorizing first-party (#16565) 2025-05-05 11:40:01 -05:00
ruff_python_stdlib python_stdlib: update for 3.14 (#18014) 2025-05-11 11:25:54 -05:00
ruff_python_trivia Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_trivia_integration_tests Pass ParserOptions to the parser (#16220) 2025-02-19 10:50:50 -05:00
ruff_server Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_source_file Convert Message::SyntaxError to use Diagnostic internally (#17784) 2025-05-08 12:45:51 -04:00
ruff_text_size Use #[expect(lint)] over #[allow(lint)] where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_wasm Inline DiagnosticKind into other diagnostic types (#18074) 2025-05-15 10:27:21 -04:00
ruff_workspace [ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
ty [ty] Enable 'ansi' feature to fix compile error (#18116) 2025-05-15 11:43:15 +02:00
ty_ide Sync vendored typeshed stubs (#18110) 2025-05-14 22:14:52 -04:00
ty_project Use https://ty.dev/rules when linking to the rules table (#18072) 2025-05-13 19:21:06 +02:00
ty_python_semantic [ty] Make dataclass instances adhere to DataclassInstance (#18115) 2025-05-15 14:27:23 +02:00
ty_server Convert Message::SyntaxError to use Diagnostic internally (#17784) 2025-05-08 12:45:51 -04:00
ty_test [ty] Shorten snapshot names (#18039) 2025-05-13 18:43:19 +02:00
ty_vendored Sync vendored typeshed stubs (#18110) 2025-05-14 22:14:52 -04:00
ty_wasm Avoid initializing progress bars early (#18049) 2025-05-12 15:07:55 -04:00