refactor: move scattered business logic into domain
- CodeGraph::merge_project_edges() replaces presentation-layer function - Language::is_test_file() centralises test file detection (was in walkdir) - AnalysisConfig::is_standard_excluded() centralises default dir exclusions (was in walkdir) - normalize_cargo_package() / normalize_python_package() in domain replace duplicated normalisers in each adapter - walkdir, cargo-workspace, python-project updated to call domain methods
This commit is contained in:
@@ -5,7 +5,7 @@ use serde::Deserialize;
|
||||
|
||||
use archlens_domain::{
|
||||
CodeElement, CodeElementKind, CodeGraph, DomainError, FilePath, ModuleName, Relationship,
|
||||
RelationshipKind, ports::ProjectAnalyzer,
|
||||
RelationshipKind, normalize_cargo_package, ports::ProjectAnalyzer,
|
||||
};
|
||||
|
||||
pub struct CargoWorkspaceAnalyzer;
|
||||
@@ -97,7 +97,7 @@ impl ProjectAnalyzer for CargoWorkspaceAnalyzer {
|
||||
.map_err(|e| DomainError::ConfigError(e.to_string()))?;
|
||||
|
||||
for dep_name in member.dependencies.keys() {
|
||||
let normalized = dep_name.replace('_', "-");
|
||||
let normalized = normalize_cargo_package(dep_name);
|
||||
if name_set.contains(&normalized)
|
||||
&& let Ok(rel) =
|
||||
Relationship::new(package_name, &normalized, RelationshipKind::Composition)
|
||||
|
||||
Reference in New Issue
Block a user