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

Function check_varlog

crates/lib/src/lints.rs:680–694  ·  view source on GitHub ↗
(root: &Dir, config: &LintExecutionConfig)

Source from the content-addressed store, hash-verified

678 check_varlog,
679);
680fn check_varlog(root: &Dir, config: &LintExecutionConfig) -> LintResult {
681 let Some(d) = root.open_dir_optional("var/log")? else {
682 return lint_ok();
683 };
684 let mut nonempty_regfiles = BTreeSet::new();
685 collect_nonempty_regfiles(&d, "/var/log".into(), &mut nonempty_regfiles)?;
686
687 if nonempty_regfiles.is_empty() {
688 return lint_ok();
689 }
690
691 let header = "Found non-empty logfiles";
692 let items = nonempty_regfiles.iter().map(PathQuotedDisplay::new);
693 format_lint_err_from_items(config, header, items)
694}
695
696#[distributed_slice(LINTS)]
697static LINT_VAR_TMPFILES: Lint = Lint::new_warning(

Callers 1

test_varlogFunction · 0.85

Calls 6

lint_okFunction · 0.85
intoMethod · 0.45
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by 1

test_varlogFunction · 0.68