feat: ship configurable lint CLI and Tool v1 bundle
This commit is contained in:
1 parent
f26f6099f2
commit
94c36270fa
16 files changed
+1403
-19
No files matched your search
+12
-4
@@ -30,18 +30,26 @@ pub fn check_function(markdown: &MarkdownTree, analysis: &AnalysisFunction) -> V
|
||||
if !tree.complete {
|
||||
return Vec::new();
|
||||
}
|
||||
check_aligned(markdown, analysis, &tree)
|
||||
}
|
||||
|
||||
pub(crate) fn check_aligned(
|
||||
markdown: &MarkdownTree,
|
||||
analysis: &AnalysisFunction,
|
||||
tree: &ReadableControlTree,
|
||||
) -> Vec<Diagnostic> {
|
||||
let mut diagnostics = Vec::new();
|
||||
for (index, control) in tree.controls.iter().enumerate() {
|
||||
match control.kind {
|
||||
ControlKind::Branch => {
|
||||
branch_rules(markdown, analysis, &tree, control, &mut diagnostics)
|
||||
branch_rules(markdown, analysis, tree, control, &mut diagnostics)
|
||||
}
|
||||
ControlKind::Loop => {
|
||||
loop_rules(markdown, analysis, &tree, control, &mut diagnostics)
|
||||
loop_rules(markdown, analysis, tree, control, &mut diagnostics)
|
||||
}
|
||||
}
|
||||
nesting_rule(markdown, &tree, index, &mut diagnostics);
|
||||
end_rule(markdown, &tree, control, &mut diagnostics);
|
||||
nesting_rule(markdown, tree, index, &mut diagnostics);
|
||||
end_rule(markdown, tree, control, &mut diagnostics);
|
||||
}
|
||||
diagnostics.sort_by(|left, right| {
|
||||
(left.span.start, left.span.end, &left.id).cmp(&(
|
||||
|
||||
Reference in new issue
Block a user