Skip to content

Releases: lfe/fmt

0.4.0 Release Notes

Choose a tag to compare

@oubiwann oubiwann released this 28 Jun 00:05

2026-06-27 · first release on hex.pm

The capstone of the migration: lfmt is now an installable, dependency-free
library with a stable public API.

{deps, [{lfmt, "~> 0.4"}]}.

Highlights

  • First public release on hex.pm. Zero runtime dependencies; OTP 27+.
  • Multi-engine public API. A single stable surface sits in front of
    pluggable formatting engines:
    • lfmt:format/1 — format with the default engine.
    • lfmt:new/1 + lfmt:format/2 — build a reusable formatter for a chosen
      engine, e.g. lfmt:new(#{engine => fezzik}).
    • An lfmt_engine behaviour and a shared #lfmt_opts{} record define the
      contract the future pe/pc engines implement.
    • The fezzik engine ships; pe/pc are reserved — selecting one that
      isn't available yet is reported explicitly, never silently ignored.
  • Renderer decomposed (pure, behaviour-identical refactor). The monolithic
    lfmt_fezzik.erl (~1,870 lines) was split into a thin orchestrator plus a
    render core (lfmt_fezzik_render), leaf helpers (lfmt_fezzik_util), and a
    shared lfmt_fezzik.hrl, with strictly one-way layering
    (lexer → cst → util → render → fezzik). Verified byte-identical against the
    pre-split output over the full corpus.
  • Adopted by rebar3_lfe. As of rebar3_lfe 0.5.5, the rebar3 lfe format
    provider delegates to lfmt; its bundled formatter engine has been removed.
  • Honest test harness. The corpus sweep now flattens output via the
    Unicode-safe path, so all 32 corpus files are exercised (previously 2 multibyte
    files were silently skipped).
  • Local CI parity. A Makefile mirrors every CI job — run make ci to
    reproduce the full gate locally before pushing.

Usage

{ok, IoData} = lfmt:format(<<"(defun id (x) x)">>),
Bin = unicode:characters_to_binary(IoData).

Formatted output can contain Unicode codepoints (> 127), so convert it with
unicode:characters_to_binary/1not iolist_to_binary/1.

0.3.0 Release Notes

Choose a tag to compare

@oubiwann oubiwann released this 28 Jun 00:04

2026-06-26 · migration milestone (not published to hex)

  • Renamed under the lfmt namespace. Engine modules r3lfe_format*
    lfmt_fezzik*; the OTP application fmtlfmt. Hex package metadata
    (description, Apache-2.0 license, project links) staged for the upcoming
    release.
  • Unicode-honest test harness. Removed the 7-bit-ASCII carve-out that had
    excluded multibyte source files from the inline oracles. The oracles now
    flatten formatter output with unicode:characters_to_binary, so the multibyte
    corpus files (core-macros.lfe, clj-tests.lfe) are fully exercised. This
    closes a latent harness defect carried since 0.1.0.

0.2.0 Release Notes

Choose a tag to compare

@oubiwann oubiwann released this 28 Jun 00:04

2026-06-25 · migration milestone (not published to hex)

  • Refined the brute-force formatting rules (the "rules v2" design record),
    carried in with history.
  • Removed the docs/design/022-lfe-format/ staging directory now that the design
    record lives under the project's planning tree.

0.1.0 Release Notes

Choose a tag to compare

@oubiwann oubiwann released this 28 Jun 00:03

2026-06-15 · migration milestone (not published to hex)

  • Established the standalone repo. The "Fezzik" brute-force LFE formatter was
    extracted from rebar3_lfe into lfe/fmt with full git history preserved.
  • A working LFE pretty-printer. Reads LFE source and emits a consistent,
    canonical layout — preserving comments and guaranteeing idempotence
    (format(format(X)) == format(X)).
  • Real test substrate. A 32-file real-world corpus plus a four-oracle harness
    checking idempotence, token preservation, AST equivalence, and comment
    preservation.