Credence.RuleScaffold
(credence v0.7.0)
Copy Markdown
Pure templates for a new rule and its test files. files/2 returns
[{path, content}] for a type — no disk I/O — so it is testable in memory and
reused by both the Mix task (mix credence.gen.rule) that writes the files and
the pin (Credence.GeneratorMetaTest) that proves the output passes every
structural gate.
The emitted tests are intentionally red: each carries a real positive /
transform assertion that fails against the inert stub, alongside the negative /
fixpoint / attribution shapes the structural gates require — so the gates pass
while the rule is unmistakably unfinished. Fixtures are heredocs and use
parseable placeholders (foo(bar) / baz(qux)), so the parser never crashes on
them at runtime.
Templates carry __TQ__ for a """ heredoc delimiter (so the template strings
themselves don't nest heredocs) and __RULE_MODULE__ / __TEST_MODULE__ /
__RULE__ / __SNAKE__ name slots, all filled by render/3 from
Credence.RuleName.
Summary
Functions
File plans ([{path, content}]) for a new name rule of type.
Functions
@spec files(String.t(), Credence.RuleName.rule_type()) :: [{String.t(), String.t()}]
File plans ([{path, content}]) for a new name rule of type.