# `ArchTest.Violation`
[🔗](https://github.com/yoavgeva/arch_test/blob/v0.2.0/lib/arch_test/violation.ex#L1)

Represents a single architecture rule violation.

Violations are collected during rule evaluation and reported as
ExUnit assertion failures with human-readable messages.

# `t`

```elixir
@type t() :: %ArchTest.Violation{
  callee: module() | nil,
  caller: module() | nil,
  message: String.t(),
  module: module() | nil,
  path: [module()] | nil,
  type: violation_type()
}
```

# `violation_type`

```elixir
@type violation_type() ::
  :forbidden_dep
  | :missing_dep
  | :naming
  | :existence
  | :cycle
  | :metric
  | :custom
```

# `cycle`

```elixir
@spec cycle([module()], String.t()) :: t()
```

Builds a `:cycle` violation.

# `existence`

```elixir
@spec existence(module(), String.t()) :: t()
```

Builds an `:existence` violation (module should not exist).

# `forbidden_dep`

```elixir
@spec forbidden_dep(module(), module(), String.t()) :: t()
```

Builds a `:forbidden_dep` violation.

# `format`

```elixir
@spec format(t()) :: String.t()
```

Formats a single violation into a human-readable string.

# `format_all`

```elixir
@spec format_all([t()]) :: String.t()
```

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.

# `naming`

```elixir
@spec naming(module(), String.t()) :: t()
```

Builds a `:naming` violation.

# `transitive_dep`

```elixir
@spec transitive_dep(module(), module(), [module()], String.t()) :: t()
```

Builds a `:forbidden_dep` violation with a transitive path shown.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
