Skip to content

Commit 83d0fdf

Browse files
committed
expand Message docs
1 parent 24e9502 commit 83d0fdf

File tree

1 file changed

+9
-1
lines changed
  • crates/ruff_linter/src/message

1 file changed

+9
-1
lines changed

crates/ruff_linter/src/message/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ mod sarif;
4242
mod text;
4343

4444
/// Message represents either a diagnostic message corresponding to a rule violation or a syntax
45-
/// error message raised by the parser.
45+
/// error message.
46+
///
47+
/// All of the information for syntax errors is captured in the underlying [`db::Diagnostic`], while
48+
/// rule violations can have the additional optional fields like fixes, suggestions, and (parent)
49+
/// `noqa` offsets.
50+
///
51+
/// Note also that the we are (mis-)using the diagnostic's primary message to store the Pascal-case
52+
/// rule name, such as `MissingNewlineAtEndOfFile`, for use in retrieving the corresponding [`Rule`]
53+
/// in [`Message::rule`].
4654
#[derive(Clone, Debug, PartialEq, Eq)]
4755
pub struct Message {
4856
pub diagnostic: db::Diagnostic,

0 commit comments

Comments
 (0)