mix credence.gen.rule (credence v0.7.1)

Copy Markdown

Generate a correctly-shaped rule plus its test files for a type.

mix credence.gen.rule <Name> [--type pattern|syntax|semantic]

<Name> may be NoFooBar or no_foo_bar. --type defaults to pattern.

The generated tests are intentionally red: they carry real assertions that fail against the empty stub, so mix test shows you exactly what to fill in, while every structural meta gate (naming, positive+negative, whole-string fix, heredoc fixtures, …) already passes. No registration step — rules are auto-discovered by their @behaviour.

If any target file already exists, the task writes nothing and aborts.