refactor: move scattered business logic into domain
Some checks failed
CI / Check / Test (push) Failing after 44s
Architecture Docs / Generate diagrams (push) Successful in 3m21s

- 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:
2026-06-17 10:58:42 +02:00
parent 428faa957c
commit e26151b4a1
10 changed files with 262 additions and 87 deletions

View File

@@ -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)