LemonCore.Quality.ArchitectureDocs (lemon_core v0.1.0)

View Source

Renders and validates the generated dependency-policy section in the architecture boundaries document.

Summary

Types

issue()

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

report()

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

Functions

check(root)

@spec check(String.t()) :: {:ok, report()} | {:error, report()}

doc_relative_path()

@spec doc_relative_path() :: String.t()

generate(root)

@spec generate(String.t()) :: {:ok, String.t(), String.t()} | {:error, issue()}

render_dependency_policy_markdown()

@spec render_dependency_policy_markdown() :: String.t()

replace_generated_section(content, rendered_markdown \\ render_dependency_policy_markdown())

@spec replace_generated_section(String.t(), String.t()) ::
  {:ok, String.t()} | {:error, issue()}

write(root)

@spec write(String.t()) :: :ok | {:error, issue()}