diff options
author | Akshay <[email protected]> | 2021-09-21 16:21:20 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-09-21 16:21:20 +0100 |
commit | 7953d8cc9345794613ba2e7b90af9429579bc0cf (patch) | |
tree | bccaa3ba5623055c76cebd226efcca0ecd4db017 /lib/src/lints/bool_comparison.rs | |
parent | 3eec886fe83b30636622d6ba97880bf473de8a0a (diff) |
add error code and report codegen, document a bit
Diffstat (limited to 'lib/src/lints/bool_comparison.rs')
-rw-r--r-- | lib/src/lints/bool_comparison.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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::{ | |||
10 | #[lint( | 10 | #[lint( |
11 | name = "bool_comparison", | 11 | name = "bool_comparison", |
12 | note = "Unnecessary comparison with boolean", | 12 | note = "Unnecessary comparison with boolean", |
13 | code = 1, | ||
13 | match_with = SyntaxKind::NODE_BIN_OP | 14 | match_with = SyntaxKind::NODE_BIN_OP |
14 | )] | 15 | )] |
15 | struct BoolComparison; | 16 | struct BoolComparison; |
@@ -70,10 +71,7 @@ impl Rule for BoolComparison { | |||
70 | non_bool_side, | 71 | non_bool_side, |
71 | bool_side | 72 | bool_side |
72 | ); | 73 | ); |
73 | Some( | 74 | Some(Self::report().suggest(at, message, Suggestion::new(at, replacement))) |
74 | Report::new(Self::note()) | ||
75 | .suggest(at, message, Suggestion::new(at, replacement)) | ||
76 | ) | ||
77 | } else { | 75 | } else { |
78 | None | 76 | None |
79 | } | 77 | } |