Skip to main content

format

Function format 

Source
pub fn format(
    files: &[PathBuf],
    tool: &ClangFormat<'_>,
    check: bool,
    runner: &(dyn Runner + Sync),
) -> Formatted
Expand description

Formats files with tool: each is run through clang-format and compared with what it holds; one that differs is rewritten unless check (docs/en/specs/commands.md, “cuno fmt”). A file is never rewritten with empty output, nor when it changed while clang-format ran, and is replaced whole, never truncated in place.