Skip to content
CAI
Software that uses CAICheck a score

WhatsApp/erlfmt

78.0

Strong · 23 September 2026

3.6k

lines of production code

Erlang

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is an Erlang code formatter named erlfmt, designed to automatically format Erlang source code according to a strict, opinionated style guide. It provides a command-line interface to format files, check for style compliance, and handle edge cases like comments and Unicode. The project also includes comprehensive documentation of the formatter's design decisions and empirical analysis of comment usage across major Erlang codebases to justify its formatting rules.

Features

Add analysis of comment formatting conventions across multiple codebases

The \doc/FormattingDecisionComments\ directory now contains a new set of analysis tools and generated reports that evaluate Erlang comment usage across several codebases (OTP, kazoo, Inaka, MongooseIM, ejabberd, and WhatsApp). The \types.py\ and \types.md\ files provide a breakdown of comment types (standalone, following, aligned) and the number of percentage symbols used, while \columns.py\ and \columns.html\ generate an interactive Plotly chart visualizing the column distribution of aligned comments. Additionally, \module\_comments.sh\ and \module\_comments.md\ analyze the number of percentage symbols used for module documentation comments. These resources serve as empirical evidence to guide formatting recommendations.

doc/FormattingDecisionComments · high confidence

Add project configuration and documentation files

Added .gitignore, CLAUDE.md, Makefile, RELEASE.md, StyleGuide.md, erlang\_ls.config, rebar.config, and rebar.lock files. These changes establish the project's build, test, and release workflows, define the Erlang Language Server configuration, and provide documentation on the formatter's style guide and release process.

(repo-wide) · high confidence

Introduce erlfmt as a standalone Erlang code formatter

The erlfmt tool is now available as a standalone Erlang application, providing a new command-line interface for formatting Erlang source code. This includes a new \erlfmt.app.src\ for application metadata, a main entry point in \erlfmt.erl\ that handles CLI arguments and file processing, a dedicated CLI module (\erlfmt\_cli.erl\) for argument parsing and parallel file processing, and supporting modules for the formatting algebra (\erlfmt\_algebra.erl\), formatting logic (\erlfmt\_format.erl\), comment re-insertion (\erlfmt\_recomment.erl\), and token scanning (\erlfmt\_scan.erl\). The formatter supports options such as \--print-width\, \--check\, \--require-pragma\, and \--range\ for partial formatting.

src · high confidence

Published formatting decision documents for the Erlang formatter

The \doc\ directory now contains a series of new Markdown files that document the \erlfmt\ formatter's design decisions. These include comparisons with other Erlang formatters (\ErlangFormatterComparison.md\) and specific formatting rules for operators (\FormattingDecisionAssociative.md\), comments (\FormattingDecisionComments.md\), default line width (\FormattingDecisionDefaultWidth.md\), list comprehensions (\FormattingDecisionListComprehensions.md\), lists (\FormattingDecisionLists.md\), pipes (\FormattingDecisionPipes.md\), spaces (\FormattingDecisionSpaces.md\), and multiline guards (\FormattingDecisionWhenMultilineGuards.md\). These documents explain the rationale behind the formatter's opinionated style choices, such as using 4 spaces for indentation, a 100-character default line width, and specific handling of macros and comments.

doc · high confidence

Test coverage

Add CLI test suite data for formatting edge cases; Added test suite for markdown file formatting; Updated test fixtures for erlfmt integration.

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

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 68 → 78 (+10.4)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 82 → 91 (+9.4)
  • Architecture 100 → 100 (+0.0)
  • Maturity 64 → 69 (+4.7)
  • Readiness 64 → 78 (+13.7)
  • Security 68 → 97 (+29.8)

Resolved (15)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included
  • The table of contents lists Comparison with other Erlang formatters but no dedicated comparison document; this is a thin gap in an otherwise comprehensive set of documents. (README.md)
  • TooManyMethods: erlfmt (src/erlfmt.erl)
  • TooManyMethods: erlfmt_format (src/erlfmt_format.erl)
  • complexity unreadable for .erl, .hrl, .py — churn × complexity hotspots could not be measured

New (32)

  • Consequences/trade-offs are not visible in the excerpt (the body ends at clip marker mid-analysis) (doc/FormattingDecisionPipes.md)
  • Coverage not measured — no coverage collector is wired up
  • Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
  • Documentation: no architecture or design documentation (README.md)
  • Documentation: no installation or build instructions
  • Duplicated block (14 lines × 2) (src/erlfmt.erl)
  • Duplicated block (5 lines × 2) (src/erlfmt_recomment.erl)
  • Further orphaned files (smaller)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: src/erlfmt_cli.erl (src/erlfmt_cli.erl)
  • Hotspot: src/erlfmt_format.erl (src/erlfmt_format.erl)
  • Medium: security finding (details withheld)
  • Off-boarding risk: anonymized user #1
  • Orphaned knowledge (src/erlfmt_algebra.erl)
  • TodoComment (test/erlfmt_SUITE_data/comments.erl)
  • …and 12 more

Written by watchdog.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 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7017592afe216fc18803f72291f4118cd2266fa8 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.