Credence.Semantic (credence v0.5.0)

Copy Markdown

Semantic phase — fixes compiler warnings and errors.

Uses Code.with_diagnostics/1 to compile the source and capture diagnostics without permanently loading modules. Delegates to rules implementing Credence.Semantic.Rule behaviour.

When compilation succeeds, warning-level diagnostics are matched against rules and fixed. When compilation fails, error-level diagnostics are matched first; if any fix is applied, the phase retries (up to max_passes) to catch warnings that only appear once the error is resolved.

Summary

Functions

analyze(source, opts \\ [])

@spec analyze(
  String.t(),
  keyword()
) :: [Credence.Issue.t()]

fix(source, opts \\ [])

@spec fix(
  String.t(),
  keyword()
) :: String.t()