feat: adopt marqdo 3.0.0-rc.4 public analysis boundary

This commit is contained in:
cflmy committed 2026-11-25 21:18:35 +08:00
1 parent 769550b14b
commit fe18df6c4b
74 files changed
+7618 -5368

No files matched your search

+5 -14
View File
@@ -2,11 +2,11 @@ use crate::{
alignment::align_function,
config::EffectiveConfig,
diagnostics::Diagnostic,
input::{MarkdownOrigin, SourceDocument},
input::SourceDocument,
metrics::{measure_module_function, FunctionNarrative},
rules::{
check_aligned, check_ast_document, check_entry_for_heading, check_entry_without_analysis,
check_function_documentation, check_supplemental_function,
check_aligned, check_ast_document, check_entry_for_heading, check_function_documentation,
check_supplemental_function,
},
};
@@ -22,11 +22,7 @@ pub fn analyze_document(document: &SourceDocument, config: &EffectiveConfig) ->
let mut diagnostics = check_ast_document(document);
let mut metrics = Vec::new();
let mut alignment_issues = Vec::new();
let module = document
.module
.as_ref()
.filter(|_| document.markdown_origin == MarkdownOrigin::MarqdoInspect);
if let Some(module) = module {
if let Some(module) = &document.module {
for function in &module.functions {
let tree = align_function(markdown, function);
if !tree.complete {
@@ -35,10 +31,7 @@ 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))
{
if let Some(heading) = markdown.function_segment(&function.id) {
diagnostics.extend(check_entry_for_heading(markdown, heading));
}
continue;
@@ -61,8 +54,6 @@ pub fn analyze_document(document: &SourceDocument, config: &EffectiveConfig) ->
metrics.push(narrative);
}
}
} else {
diagnostics.extend(check_entry_without_analysis(document));
}
diagnostics.sort_by(|left, right| (left.span, &left.id).cmp(&(right.span, &right.id)));
DocumentAnalysis {