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.
- Boundary
Violation Finding - One boundary-violation finding.
- Boundary
Violations Config - Config for the
boundary-violationsrule, deserialized from[rules.rule."boundary-violations"]in.normalize/config.toml.
Functions§
- build_
boundary_ violations_ report - Build a
DiagnosticsReportfor theboundary-violationsrule. - parse_
boundary - Parse a boundary string of the form
"A cannot import B". ReturnsNoneif the string doesn’t match the expected format.