LemonCore.Quality.ArchitectureRulesCheck (lemon_core v0.1.0)

View Source

Enforces explicit architecture guardrails that are easier to express as stable source-pattern checks than dependency graph rules.

Two rule families run here:

  • source-pattern rules (@rules) โ€” substring matches against source files;
  • module-reference rules (@module_reference_rules) โ€” the package dependency rules from docs/platform-split.md ยง2, resolved from each file's AST so that aliases, calls and dynamic :"Elixir.Foo" atoms all count while mentions in docs and comments do not.

Module-reference rules cover lib/ only: test support is allowed to reach across apps. Existing violations are listed in @grandfathered.

Summary

Functions

The grandfathered cross-boundary references, for tooling and tests.

Types

issue()

@type issue() :: %{code: atom(), message: String.t(), path: String.t()}

report()

@type report() :: %{
  root: String.t(),
  issue_count: non_neg_integer(),
  issues: [issue()]
}

Functions

grandfathered()

@spec grandfathered() :: [%{app: atom(), pattern: String.t(), file: String.t()}]

The grandfathered cross-boundary references, for tooling and tests.

run(opts \\ [])

@spec run(keyword()) :: {:ok, report()} | {:error, report()}