Skip to main content

Module spec_normalize

Module spec_normalize 

Source
Expand description

Canonical pretty-printer for -spec/-callback/-type right-hand sides.

The job: produce a single canonical string for any given semantic signature, so reformatting in source produces no snapshot diff. The algorithm is intentionally simple: it normalizes whitespace, balances brackets, wraps at top-level | past a width target.

Functionsยง

normalize_elixir_signature
Elixir entry point: $ is an ordinary byte in Elixir type text, so the char-literal-aware Erlang lexing must not apply.
normalize_signature
Erlang entry point: $c char literals, triple-quoted strings, and sigils are lexed as such, so $" or $, cannot derail the walk.