feat: add config validation and dependency cycle detection
- Config::validate() checks project.root, language, scan.include, python.src_roots, caching.max_cache_age, and scan.max_file_size - Add parse_duration() and parse_file_size() helper functions - Implement DFS-based cycle detection in cycle_detector.rs - Wire cycle detection into renderer critical points section - Add comprehensive unit tests for all new functionality
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
//! This module handles generating Markdown documentation from the project model
|
||||
//! using templates.
|
||||
|
||||
use crate::cycle_detector;
|
||||
use crate::model::ProjectModel;
|
||||
use handlebars::Handlebars;
|
||||
|
||||
@@ -493,7 +494,14 @@ impl Renderer {
|
||||
let data = serde_json::json!({
|
||||
"high_fan_in": high_fan_in,
|
||||
"high_fan_out": high_fan_out,
|
||||
"cycles": Vec::<String>::new(), // TODO: Implement cycle detection
|
||||
"cycles": cycle_detector::detect_cycles(model)
|
||||
.iter()
|
||||
.map(|cycle| {
|
||||
serde_json::json!({
|
||||
"cycle_path": format!("{} → {}", cycle.join(" → "), cycle.first().unwrap_or(&String::new()))
|
||||
})
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
});
|
||||
|
||||
// Create a smaller template just for the critical points section
|
||||
|
||||
Reference in New Issue
Block a user