Credence.Pattern
(credence v0.4.2)
Copy Markdown
Pattern phase — detects and fixes anti-patterns in Elixir code.
Delegates to the 80+ rules implementing Credence.Pattern.Rule behaviour.
Rules are discovered automatically and run in priority order (lower first),
with module name as tiebreaker for determinism.
Summary
Functions
@spec analyze( String.t(), keyword() ) :: [Credence.Issue.t()]
@spec fix_with_trace( String.t(), keyword() ) :: {String.t(), [{module(), non_neg_integer()}]}
Like fix/2, but also returns a list of {rule_module, issue_count} tuples
for every rule that actually fired and was applied.
Every step is logged via Logger.debug with [credence_fix] prefix:
rule name, issue count, whether the source changed, and a before/after
diff of the lines that were modified.