Skip to main content

build_stale_doc_report

Function build_stale_doc_report 

Source
pub fn build_stale_doc_report(
    root: &Path,
    config: StaleDocConfig,
    files: Option<&[PathBuf]>,
) -> DiagnosticsReport
Expand description

Build a DiagnosticsReport for the stale-doc rule.

For each documentation file matching the configured patterns, finds co-change partners (code files it historically changes with) and flags the doc file if any partner was committed more recently by at least min_lag_days.

Gracefully degrades if:

  • The index is not built → returns empty report with a tool error note.
  • The co_change_edges table is empty → returns empty report with a tool error note.
  • A file’s last commit time cannot be determined → skips the comparison.