Skip to content
CAI
Software that uses CAICheck a score

WhatsApp/erlfmt

70.3

Strong · 13 November 2026

3.6k

lines of production code

Erlang

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

erlfmt is an opinionated Erlang code formatter designed to provide consistent code styling through a command-line interface and a rebar3 plugin integration. It supports standard formatting options such as line width configuration, in-place modification, and CI validation checks, while also managing specific pragma directives for selective formatting control. The system includes comprehensive test suites and empirical analysis tools to guide its formatting decisions and ensure robust handling of various Erlang language constructs and edge cases.

Features

Added empirical analysis of Erlang comment formatting conventions

The \doc/FormattingDecisionComments\ directory now contains a suite of scripts and generated reports that analyze comment usage across several Erlang codebases (OTP, WhatsApp, kazoo, MongooseIM, ejabberd, and Inaka). The new \types.py\ and \module\_comments.sh\ scripts quantify the prevalence of standalone, following, and aligned comments, as well as the number of percentage symbols used for module documentation. These analyses feed into \types.md\, \module\_comments.md\, and \columns.html\ (generated via \columns.py\), providing data-driven evidence to guide formatting decisions, such as the recommendation for the \%%% @format\ pragma.

doc/FormattingDecisionComments · high confidence

Documentation of formatting decisions and formatter comparisons

Added a series of documentation files in the \doc/\ directory that explain the rationale behind \erlfmt\'s formatting choices, including handling of comments, list comprehensions, pipes, commas, indentation width, and the \erlfmt-ignore\ pragma. Also added a comparison document (\ErlangFormatterComparison.md\) detailing how \erlfmt\ differs from other Erlang formatters like \rebar3\_format\, \streamroller\, and \erl\_tidy\ regarding file types, macro support, and comment preservation.

doc · high confidence

Initial project scaffolding and configuration for erlfmt

Establishes the foundational project structure for the erlfmt Erlang code formatter. This includes the rebar3 build configuration (rebar.config) defining the escript entry point, dependencies (getopt, eqwalizer\_support), and the erlfmt provider hook for the \rebar3 fmt\ command. It adds a Makefile to automate build, test, and formatting workflows, a .gitignore file to exclude build artifacts and generated parser code, and documentation files (README.md, CLAUDE.md, StyleGuide.md, RELEASE.md) detailing usage, design principles, and release procedures.

(repo-wide) · high confidence

Introduce erlfmt, an opinionated Erlang code formatter

This release adds erlfmt, a new tool for formatting Erlang code. It provides a command-line interface for formatting files and a rebar3 plugin (\rebar3 fmt\) for integration into existing build workflows. The formatter supports standard options such as \--write\ for in-place modification, \--check\ for CI validation, \--print-width\ for line length configuration, and \--require-pragma\ to enforce formatting only on files containing a specific comment. It also handles pragma management (\--insert-pragma\, \--delete-pragma\) and allows formatting specific ranges within a file.

src · high confidence

Test coverage

Add comprehensive test suites and diagnostic helpers for erlfmt; Added CLI test suite data files; Expanded test suite for formatting edge cases and ignore directives.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 71 → 70 (-0.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 95 → 94 (-1.0)
  • Architecture 100 → 96 (-4.3)
  • Maturity 71 → 71 (+0.6)
  • Readiness 56 → 56 (+0.0)
  • Security 98 → 98 (+0.0)

Resolved (1)

  • No consequences/trade-offs section describing the cost of making pipes a prefix (doc/FormattingDecisionPipes.md)

New (4)

  • Edited copy of a member (12 corresponding lines) (src/erlfmt.erl)
  • Edited copy of a member (13 corresponding lines) (src/erlfmt.erl)
  • Edited copy of a member (26 corresponding lines) (src/erlfmt.erl)
  • Edited copy of a member (9 corresponding lines) (src/erlfmt_format.erl)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

WhatsApp/erlfmt was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 94d66dec10634cc86b0d9a31d28317518cc1da7f — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.