From 7953d8cc9345794613ba2e7b90af9429579bc0cf Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 21 Sep 2021 20:51:20 +0530 Subject: add error code and report codegen, document a bit --- lib/src/lints/bool_comparison.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/src/lints') diff --git a/lib/src/lints/bool_comparison.rs b/lib/src/lints/bool_comparison.rs index f869e17..d23a4b0 100644 --- a/lib/src/lints/bool_comparison.rs +++ b/lib/src/lints/bool_comparison.rs @@ -10,6 +10,7 @@ use rnix::{ #[lint( name = "bool_comparison", note = "Unnecessary comparison with boolean", + code = 1, match_with = SyntaxKind::NODE_BIN_OP )] struct BoolComparison; @@ -70,10 +71,7 @@ impl Rule for BoolComparison { non_bool_side, bool_side ); - Some( - Report::new(Self::note()) - .suggest(at, message, Suggestion::new(at, replacement)) - ) + Some(Self::report().suggest(at, message, Suggestion::new(at, replacement))) } else { None } -- cgit v1.2.3