MCPcopy Create free account
hub / github.com/bootc-dev/bootc / lint

Function lint

crates/lib/src/lints.rs:377–403  ·  view source on GitHub ↗
(
    root: &Dir,
    warning_disposition: WarningDisposition,
    root_type: RootType,
    skip: impl IntoIterator<Item = &'skip str>,
    mut output: impl std::io::Write,
    no_truncate: bool,
)

Source from the content-addressed store, hash-verified

375
376#[context("Linting")]
377pub(crate) fn lint<'skip>(
378 root: &Dir,
379 warning_disposition: WarningDisposition,
380 root_type: RootType,
381 skip: impl IntoIterator<Item = &'skip str>,
382 mut output: impl std::io::Write,
383 no_truncate: bool,
384) -> Result<()> {
385 let config = LintExecutionConfig { no_truncate };
386 let r = lint_inner(root, root_type, &config, skip, &mut output)?;
387 writeln!(output, "Checks passed: {}", r.passed)?;
388 if r.skipped > 0 {
389 writeln!(output, "Checks skipped: {}", r.skipped)?;
390 }
391 let fatal = if matches!(warning_disposition, WarningDisposition::FatalWarnings) {
392 r.fatal + r.warnings
393 } else {
394 r.fatal
395 };
396 if r.warnings > 0 {
397 writeln!(output, "Warnings: {}", r.warnings)?;
398 }
399 if fatal > 0 {
400 anyhow::bail!("Checks failed: {}", fatal)
401 }
402 Ok(())
403}
404
405/// check for the existence of the /var/run directory
406/// if it exists we need to check that it links to /run if not error

Callers 2

test_lint_mainFunction · 0.85
run_from_optFunction · 0.85

Calls 1

lint_innerFunction · 0.85

Tested by 1

test_lint_mainFunction · 0.68