From 8073a45f81f3d347ea44fc650308376613df18c1 Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Sat, 19 Oct 2024 03:50:27 +0000 Subject: [PATCH] book: show if a lint is disabled by default --- book-lints/src/main.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/book-lints/src/main.rs b/book-lints/src/main.rs index cb93af32..f3ccfa3d 100644 --- a/book-lints/src/main.rs +++ b/book-lints/src/main.rs @@ -47,8 +47,13 @@ fn config(chapter: &mut Chapter) { text.push_str(&format!("\n***\n## {}\n", lint.ident())); text.push_str(&format!("Code: **L-C{}** \n", lint.doc_ident())); text.push_str(&format!( - "Default Severity: **{:?}** \n", - lint.default_config().severity() + "Default Severity: **{:?}** {} \n", + lint.default_config().severity(), + if lint.default_config().enabled() { + "" + } else { + "(Disabled)" + }, )); text.push_str(&format!( "Minimum Severity: {:?} \n", @@ -85,8 +90,13 @@ fn sqf(chapter: &mut Chapter) { text.push_str(&format!("\n***\n## {}\n", lint.ident())); text.push_str(&format!("Code: **L-S{}** \n", lint.doc_ident())); text.push_str(&format!( - "Default Severity: **{:?}** \n", - lint.default_config().severity() + "Default Severity: **{:?}** {} \n", + lint.default_config().severity(), + if lint.default_config().enabled() { + "" + } else { + "(Disabled)" + }, )); text.push_str(&format!( "Minimum Severity: {:?} \n",