GgenIgniter.DoctorFixes.Rule (ggen_igniter v26.9.8)

Copy Markdown View Source

Data shape of one declarative doctor reconciliation rule: a (Predicate, Transformation, Verification) triple, per GgenIgniter.DoctorFixes's moduledoc. Every field is a real, single-argument function over a project_dir -- no captured mutable state, no File.cwd!()/Mix.Project reads baked in, so a Rule is as testable against a throwaway temp directory as any of the plain functions it replaces.

Summary

Types

predicate_result()

@type predicate_result() ::
  {:ok, String.t()} | {:fixable, String.t()} | {:unrecognized, String.t()}

t()

@type t() :: %GgenIgniter.DoctorFixes.Rule{
  name: String.t(),
  predicate: (Path.t() -> predicate_result()),
  transform: (Path.t() -> {:fixed, String.t()}),
  verify: (Path.t() -> boolean())
}