Skip to main content

Module boundary_violations

Module boundary_violations 

Source
Expand description

boundary-violations native rule — flags cross-boundary imports.

Users declare directory-level import boundaries in config. The rule checks all resolved imports in the structural index and reports any that violate a declared boundary.

§Configuration

[rules.rule."boundary-violations"]
enabled = true
boundaries = [
  "services/ cannot import cli/",
  "crates/normalize-facts/ cannot import crates/normalize/",
]

Each boundary string has the form "<from_glob> cannot import <to_glob>". Both globs are matched against root-relative file paths using glob::Pattern. Trailing / is allowed — it is treated as a prefix match (the pattern services/ matches any path that starts with services/).

Structs§

Boundary
A single configured boundary constraint.
BoundaryViolationFinding
One boundary-violation finding.
BoundaryViolationsConfig
Config for the boundary-violations rule, deserialized from [rules.rule."boundary-violations"] in .normalize/config.toml.

Functions§

build_boundary_violations_report
Build a DiagnosticsReport for the boundary-violations rule.
parse_boundary
Parse a boundary string of the form "A cannot import B". Returns None if the string doesn’t match the expected format.