A fast, opinionated code formatter for Lean 4 that automatically formats source code according to consistent style rules. Built on Lean's native parser for reliable performance with support for multiple output modes and easy CLI integration.
Prerequisites: Lean 4 and Lake
git clone https://github.com/toku-sa-n/leanfmt.git
cd leanfmt
lake build leanfmtAfter building, use lake exe leanfmt to run the formatter.
# Format a single file and view the result
lake exe leanfmt Main.lean
# Format a file in-place (overwrites the original)
lake exe leanfmt --in-place Main.lean
# Check if your files are properly formatted
lake exe leanfmt --check src/**/*.leanApache License 2.0 - see LICENSE file.