feat(natu): lint redundant parameter forwarding
This commit was merged in pull request #114.
This commit is contained in:
@@ -10,6 +10,7 @@ pub mod let_order;
|
||||
pub mod list_to_attrs_map;
|
||||
pub mod manual_inherit;
|
||||
pub mod manual_inherit_from;
|
||||
pub mod redundant_parameter_forwarding;
|
||||
pub mod unquoted_uri;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -89,10 +90,21 @@ pub fn run_rules(file: &ast::ParsedFile, graph: &ScopeGraph, source: &str) -> Ve
|
||||
binding: None,
|
||||
expected_order: Some(finding.expected_order),
|
||||
});
|
||||
let redundant_parameter_forwarding_diagnostics =
|
||||
redundant_parameter_forwarding::check(&file.root)
|
||||
.into_iter()
|
||||
.map(|finding| Finding {
|
||||
rule_id: "redundant_parameter_forwarding",
|
||||
range: finding.range,
|
||||
message: "Use the outer parameter instead of forwarding it",
|
||||
binding: None,
|
||||
expected_order: None,
|
||||
});
|
||||
|
||||
node_diagnostics
|
||||
.chain(token_diagnostics)
|
||||
.chain(let_order_diagnostics)
|
||||
.chain(redundant_parameter_forwarding_diagnostics)
|
||||
.filter(|finding| !is_suppressed(source, finding.range, finding.rule_id))
|
||||
.map(|finding| Diagnostic {
|
||||
file_id: file.file_id,
|
||||
|
||||
Reference in New Issue
Block a user