Skip to main content

fix_paths

Function fix_paths 

Source
pub fn fix_paths(
    paths: &[PathBuf],
    rules: &[Rule],
    config: &Config,
    baseline: Option<&Baseline>,
    baseline_root: &Path,
    unsafe_fixes: bool,
) -> Result<FixReport, ScanError>
Expand description

Apply the autofix rewrites over paths: the autofix_safe ones, plus the autofix_unsafe ones when unsafe_fixes is on.

Only builtin rules and the external rules listed in fix.allow_external are applied. Nothing is written here: FileFix carries the before/after text so the caller can print a diff (--dry-run) or persist the change. baseline suppresses rewrites already recorded against baseline_root.