MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / inspect_content

Function inspect_content

libatomic/src/review/analysis.rs:279–306  ·  view source on GitHub ↗
(
    report: &mut AnalysisReport,
    registry: &mut ParserRegistry,
    change: &str,
    path: &str,
    before: Result<Option<&[u8]>, String>,
    after: &[u8],
    added: bool,
)

Source from the content-addressed store, hash-verified

277}
278
279fn inspect_content(
280 report: &mut AnalysisReport,
281 registry: &mut ParserRegistry,
282 change: &str,
283 path: &str,
284 before: Result<Option<&[u8]>, String>,
285 after: &[u8],
286 added: bool,
287) {
288 let after = match parse(registry, path, after) {
289 Ok(after) => after,
290 Err(reason) => {
291 checks(report, change, path, CheckStatus::Skipped, &reason);
292 return;
293 }
294 };
295 let baseline = match before {
296 Ok(Some(bytes)) => parse(registry, path, bytes),
297 Ok(None) if added => Ok(StructuralInspection {
298 issues: Vec::new(),
299 has_syntax_errors: false,
300 ambiguous_manageability_subjects: Vec::new(),
301 }),
302 Ok(None) => Err("No before-content and no explicit file-creation operation".into()),
303 Err(reason) => Err(format!("Recorded before-content unavailable: {reason}")),
304 };
305 inspect_parsed(report, change, path, after, baseline, false);
306}
307
308fn inspect_parsed(
309 report: &mut AnalysisReport,

Callers 2

analyze_changeFunction · 0.85
analyzeFunction · 0.85

Calls 3

checksFunction · 0.85
inspect_parsedFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected