ArchUnitPython
ArchUnitPython copied to clipboard
[FEATURE] Clean Architecture 'Dependency Rule' preset
In short
A one-line preset for classic Clean Architecture layering: inner business logic must not depend on outer layers (web framework, database). Fails if, say, an entity imports a web controller.
Problem
The single most-requested architecture rule: source dependencies may only point inward, boundaries crossed only via interfaces. Expressible with project_layers(...) today, but a canonical preset makes it a one-liner.
Proposal
A named preset over the existing project_layers(...) API that wires the concentric inward-only direction, e.g. clean_architecture("src/").entities("**/domain/**").use_cases("**/application/**").adapters("**/infrastructure/**"), plus the dependency-inversion corollary.
Acceptance criteria
- [ ] An inner ring importing an outer ring fails with the offending edge.
- [ ] Documented as a copy-paste recipe in the README.