Lean 4 formatter
A production-worthy code formatter for the Lean 4 programming language, configurable in the style of clang-format. It handles Lean's partial elaboration with backtracking and can already format important open source Lean libraries; mathlib4 remains the hardest case.
What it addresses
Formatting mathlib4 has no viable plan yet, since it would likely require per-directory quirks files, which is probably a nonstarter.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
Lean 4 formatter
A production-worthy code formatter for the Lean 4 programming language, configurable in the style of clang-format. It handles Lean's partial elaboration with backtracking and can already format important open source Lean libraries; mathlib4 remains the hardest case.
Problem: Formatting mathlib4 has no viable plan yet, since it would likely require per-directory quirks files, which is probably a nonstarter.
Posted by @reinitctxoffset · Original source ↗
Source text · @reinitctxoffset · · Source ↗
Production-worthy formatter for lean4. Right now it copes with important open source libraries on the model of clang-format's configuration, which is a real trick given the partial elaboration you need (with backtracking). But that works. mathlib4 is the final boss, I don't currently even have a plan without per-directory quirks files which is probably a nonstarter.