Skip to main content

scope_unchanged_unused_code

Function scope_unchanged_unused_code 

Source
pub fn scope_unchanged_unused_code(
    results: &mut AnalysisResults,
    root: &Path,
    changed_files: &FxHashSet<PathBuf>,
    base: Option<&AuditKeySnapshot>,
)
Expand description

Keep an unused file or unused export outside changed_files only when the base does not report it.

The surface keeps these findings outside the changed files, because a change can make code unused without a change to that code: it removes the last import, or a config change removes an entry point. A finding that the base also reports did not come from the change, so it leaves the report. Without a base (--gate all), every such finding leaves the report. base must already use head paths.