Skip to content

Commit

Permalink
Restore message for real
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jan 30, 2024
1 parent cf8cb4f commit 5c670b6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions crates/ruff_dev/src/generate_rules_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,11 @@ fn generate_table(table_out: &mut String, rules: impl IntoIterator<Item = Rule>,
// If the message ends in a bracketed expression (like: "Use {replacement}"), escape the
// brackets. Otherwise, it'll be interpreted as an HTML attribute via the `attr_list`
// plugin. (Above, we'd convert to "Use {replacement\}".)
let message = if rule.is_removed() {
Cow::Owned("_This rule has been removed_".to_string())
let message = rule.message_formats()[0];
let message = if let Some(prefix) = message.strip_suffix('}') {
Cow::Owned(format!("{prefix}\\}}"))
} else {
let message = rule.message_formats()[0];
if let Some(prefix) = message.strip_suffix('}') {
Cow::Owned(format!("{prefix}\\}}"))
} else {
Cow::Borrowed(message)
}
Cow::Borrowed(message)
};

// Start and end of style spans
Expand Down

0 comments on commit 5c670b6

Please sign in to comment.