feat: apply layout rules and safe fixes to RC.2 control flow

This commit is contained in:
cflmy committed 2026-11-23 23:53:28 +08:00
1 parent 7282918c50
commit 81fcab0e3a
11 files changed
+621 -323

No files matched your search

+7 -1
View File
@@ -5,7 +5,7 @@ use crate::{
input::{MarkdownOrigin, SourceDocument},
metrics::{measure_module_function, FunctionNarrative},
rules::{
check_aligned, check_ast_document, check_entry_without_analysis,
check_aligned, check_ast_document, check_entry_for_heading, check_entry_without_analysis,
check_function_documentation, check_supplemental_function,
},
};
@@ -35,6 +35,12 @@ pub fn analyze_document(document: &SourceDocument, config: &EffectiveConfig) ->
.iter()
.map(|issue| format!("{}:{}", function.local_name, issue)),
);
if let Some(heading) = tree
.function
.and_then(|function| markdown.heading(function))
{
diagnostics.extend(check_entry_for_heading(markdown, heading));
}
continue;
}
diagnostics.extend(check_aligned(markdown, &tree));