Skip to content

[FEATURE] Clean Architecture 'Dependency Rule' preset #46

Description

@LukasNiessen

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions