Skip to main content

Crate rust_doctor

Crate rust_doctor 

Source
Expand description

§rust-doctor

A unified code health tool for Rust — scan, score, and fix your codebase.

rust-doctor analyzes Rust projects for security, performance, correctness, architecture, and dependency issues, producing a 0–100 health score with actionable diagnostics.

§Quick start (library usage)

use std::path::Path;

// Discover the project
let (dir, info, config) = rust_doctor::discovery::bootstrap_project(
    Path::new("."), false,
).unwrap();

// Resolve config with defaults
let resolved = rust_doctor::config::resolve_config_defaults(config.as_ref());

// Run the scan
let result = rust_doctor::scan::scan_project(&info, &resolved, false, &[], true).unwrap();
println!("Score: {}/100 ({})", result.score, result.score_label);

Modules§

cli
Command-line argument parsing and flag definitions.
config
Configuration loading, merging, and validation.
deps
External tool dependency checking and installation. External tool dependency checking and installation.
diagnostics
Core diagnostic types: Diagnostic, Severity, Category, ScanResult.
discovery
Project discovery via cargo metadata and framework detection.
error
Error types for the scan pipeline, bootstrapping, and MCP.
fixer
Auto-fix application for machine-applicable diagnostic fixes. Apply machine-applicable fixes from diagnostics to source files.
mcp
MCP (Model Context Protocol) server for AI tool integration.
output
Terminal, JSON, and score output rendering.
plan
Remediation plan generator from scan diagnostics. Remediation plan generator — turns scan diagnostics into a structured, prioritized action plan.
sarif
SARIF 2.1.0 output for CI/CD integration. SARIF 2.1.0 output for CI/CD integration (GitHub Code Scanning, GitLab SAST).
scan
Top-level scan pipeline that orchestrates all analysis passes.
setup
Interactive setup wizard for AI agent integration. Interactive setup wizard for configuring rust-doctor with AI coding agents.