Releases: lfe/fmt
Releases · lfe/fmt
Release list
0.4.0 Release Notes
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_enginebehaviour and a shared#lfmt_opts{}record define the
contract the futurepe/pcengines implement. - The
fezzikengine ships;pe/pcare 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
sharedlfmt_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 ofrebar3_lfe0.5.5, therebar3 lfe format
provider delegates tolfmt; 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
Makefilemirrors every CI job — runmake cito
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/1 — not iolist_to_binary/1.
0.3.0 Release Notes
2026-06-26 · migration milestone (not published to hex)
- Renamed under the
lfmtnamespace. Engine modulesr3lfe_format*→
lfmt_fezzik*; the OTP applicationfmt→lfmt. 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 withunicode: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
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
2026-06-15 · migration milestone (not published to hex)
- Established the standalone repo. The "Fezzik" brute-force LFE formatter was
extracted fromrebar3_lfeintolfe/fmtwith 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.