rustquty-core
Core library for rustquty, a local-first quality scanner for Rust projects.
Collectors
This crate provides 12 quality collectors:
| Collector | Description | External tool |
|---|---|---|
fmt |
Code formatting | cargo fmt |
clippy |
Linting | cargo clippy |
tests |
Test execution | cargo test / cargo nextest |
coverage |
Code coverage | cargo llvm-cov |
deny |
Banned crates & licenses | cargo deny |
audit |
Security vulnerabilities | cargo audit |
hack |
Feature powerset testing | cargo hack |
mutants |
Mutation testing | cargo mutants |
duplicates |
Duplicate line detection | built-in |
loc |
Lines of code + line length | built-in |
size |
Per-file/per-function size (AST) | built-in |
complexity |
Cyclomatic complexity + nesting (AST) | built-in |
Features
- Zero network I/O: All collectors execute local Cargo subcommands
- Parallel execution: Collectors run concurrently via
rayon - TOML configuration: Gates configured via
rustquty.toml - Ratchet model: Thresholds set from current metrics; gate fails if quality degrades
- Absolute thresholds: Industry-standard defaults (SonarQube, ESLint, Detekt)
- AST-based analysis: Uses
synv2 for precise function-level metrics
API
use ;
use PathBuf;
// Create context
let ctx = new
.with_profile;
// Build collectors
let collectors = vec!;
// Execute and assemble
let results = execute_collectors;
let summary = assemble_results;
// Gate with ratchet baseline
let report = run;
// Or gate with absolute thresholds (SonarQube standards)
let config = GateConfig ;
let report = run_with_config;
Modules
| Module | Description |
|---|---|
collector |
Collector trait, implementations, execution, and assembly |
config |
rustquty.toml parsing |
context |
Runtime context (profile, paths, disabled collectors) |
gate |
Gate logic for comparing metrics against baselines |
schema |
JSON schemas for MetricsSummary, Baseline, QualityReport |
baseline |
Baseline file creation and update |
util |
Shared utilities (ISO-8601 timestamps) |