From 34ec40ca1f8d83ab381891a95c358cd2b6c5d04f Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Fri, 18 Oct 2024 21:51:08 -0600 Subject: [PATCH] book: show if a lint is disabled by default (#807) --- 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",