Skip to content

Commit 85f03f5

Browse files
committed
Restore message for real
1 parent 1ab7a10 commit 85f03f5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

crates/ruff_dev/src/generate_rules_table.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,11 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
5959
// If the message ends in a bracketed expression (like: "Use {replacement}"), escape the
6060
// brackets. Otherwise, it'll be interpreted as an HTML attribute via the `attr_list`
6161
// plugin. (Above, we'd convert to "Use {replacement\}".)
62-
let message = if rule.is_removed() {
63-
Cow::Owned("_This rule has been removed_".to_string())
62+
let message = rule.message_formats()[0];
63+
let message = if let Some(prefix) = message.strip_suffix('}') {
64+
Cow::Owned(format!("{prefix}\\}}"))
6465
} else {
65-
let message = rule.message_formats()[0];
66-
if let Some(prefix) = message.strip_suffix('}') {
67-
Cow::Owned(format!("{prefix}\\}}"))
68-
} else {
69-
Cow::Borrowed(message)
70-
}
66+
Cow::Borrowed(message)
7167
};
7268

7369
// Start and end of style spans

0 commit comments

Comments
 (0)