Represents a single architecture rule violation.
Violations are collected during rule evaluation and reported as ExUnit assertion failures with human-readable messages.
Summary
Functions
Builds a :cycle violation.
Builds an :existence violation (module should not exist).
Builds a :forbidden_dep violation.
Formats a single violation into a human-readable string.
Formats a list of violations into a human-readable string for ExUnit output.
Returns a stable, structured key suitable for freeze baselines.
Returns sorted stable keys for all violations.
Builds a :naming violation.
Builds a :forbidden_dep violation with a transitive path shown.
Types
@type t() :: %ArchTest.Violation{ callee: module() | nil, callee_function: {atom(), non_neg_integer()} | nil, caller: module() | nil, caller_function: {atom(), non_neg_integer()} | nil, file: String.t() | nil, line: pos_integer() | nil, message: String.t(), module: module() | nil, path: [module()] | nil, type: violation_type() }
@type violation_type() ::
:forbidden_dep
| :missing_dep
| :naming
| :existence
| :cycle
| :metric
| :custom
Functions
Builds a :cycle violation.
Builds an :existence violation (module should not exist).
Builds a :forbidden_dep violation.
Formats a single violation into a human-readable string.
Formats a list of violations into a human-readable string for ExUnit output.
Groups violations by offending module where possible and adds visual separators for readability.
Returns a stable, structured key suitable for freeze baselines.
The key is intentionally line-oriented and text-friendly, but it is derived from the violation struct rather than parsed from rendered assertion output.
Returns sorted stable keys for all violations.
Builds a :naming violation.
Builds a :forbidden_dep violation with a transitive path shown.