Rulebearing Playground Coverage Schemas GitHub

ADR-0034: A slice groups .NET types or TypeScript and Python modules; (*) names a slice as ArchUnitNET does; segments keeps the first segments

Context

Three facts surfaced while porting ArchUnitNET 0.13.4's SlicesTests and reproducing import-linter's own contracts.

  1. (*) is not one segment. Plan 0002 § 2.6 says "(*) captures one segment, (**) captures the remainder". ArchUnitNET's SliceRuleInitializer.Parse rewrites Ns.(*) to Ns.(**). and keeps the count of (*) only for PlantUmlFileBuilder; the slice identifier is the whole remainder. Its own MatchingTest asserts seven slices for both TestAssembly.Slices.(*) and (**), and three for (**)...
  2. What a slice holds depends on the language. Design § Slice rules makes a slice pattern "a namespace pattern for .NET, a dotted module pattern for Python, and a path pattern for TypeScript". A .NET dependency is between types, as ArchUnitNET slices; a Python or TypeScript dependency is an import between modules. Slicing Python classes by their module sees inheritance and decorators, not imports, so an import cycle between two packages is invisible.
  3. import-linter's acyclic_siblings squashes. Under each package, a child and everything below it is one sibling. No ArchUnitNET pattern says "the first segment, the package itself included": (*) and (*).. keep the whole remainder, (**).. drops a child with no segment after it.

Decision

Consequences

Alternatives considered