feat: complete rule evidence and frozen review fixtures
This commit is contained in:
1 parent
1f4e120a53
commit
344ef28870
27 files changed
+1992
-356
No files matched your search
+11
-5
@@ -10,7 +10,7 @@ use crate::{
|
||||
model::{AnalysisModule, ExecutionProjection, MarkdownTree, SourceSnapshot},
|
||||
};
|
||||
|
||||
use super::{fallback_ast, MarqdoRunner};
|
||||
use super::{fallback_ast, CheckDiagnostic, MarqdoRunner};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
@@ -41,6 +41,7 @@ pub struct ProjectInput {
|
||||
pub analysis: Option<ExecutionProjection>,
|
||||
pub analysis_status: AnalysisStatus,
|
||||
pub core_output: String,
|
||||
pub core_diagnostics: Vec<CheckDiagnostic>,
|
||||
pub notices: Vec<String>,
|
||||
}
|
||||
|
||||
@@ -57,12 +58,13 @@ impl ProjectInput {
|
||||
analysis: None,
|
||||
analysis_status: AnalysisStatus::AnalysisIncomplete,
|
||||
core_output: check.output,
|
||||
core_diagnostics: check.diagnostics,
|
||||
notices,
|
||||
});
|
||||
}
|
||||
let raw = check.analysis.ok_or_else(|| {
|
||||
LintError::Protocol("核心 check 成功但没有生成 Analysis".into())
|
||||
})?;
|
||||
let raw = check
|
||||
.analysis
|
||||
.ok_or_else(|| LintError::Protocol("核心 check 成功但没有生成 Analysis".into()))?;
|
||||
let analysis = ExecutionProjection::from_json(raw).map_err(LintError::Protocol)?;
|
||||
let root = project_root(&entry);
|
||||
let mut documents = Vec::new();
|
||||
@@ -81,7 +83,9 @@ impl ProjectInput {
|
||||
}
|
||||
for function in &module.functions {
|
||||
function.span.validate(document.source.bytes.len())?;
|
||||
function.heading_span.validate(document.source.bytes.len())?;
|
||||
function
|
||||
.heading_span
|
||||
.validate(document.source.bytes.len())?;
|
||||
}
|
||||
document.module = Some(module.clone());
|
||||
documents.push(document);
|
||||
@@ -103,6 +107,7 @@ impl ProjectInput {
|
||||
analysis: Some(analysis),
|
||||
analysis_status: AnalysisStatus::Complete,
|
||||
core_output: String::new(),
|
||||
core_diagnostics: Vec::new(),
|
||||
notices,
|
||||
})
|
||||
}
|
||||
@@ -117,6 +122,7 @@ impl ProjectInput {
|
||||
analysis: None,
|
||||
analysis_status: AnalysisStatus::AnalysisIncomplete,
|
||||
core_output: String::new(),
|
||||
core_diagnostics: Vec::new(),
|
||||
notices,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user