Heron finds non-idiomatic Lean 4 code and fixes it: in your editor, on lake build, and in CI.
def Weekday.isWeekend (day : Weekday) : Bool :=
match day with
--^^^^^ Match on the parameters directly with `def f : A → B | pattern => …`
| .saturday | .sunday => true
| _ => falseThe quick fix turns it into
def Weekday.isWeekend : Weekday → Bool
| .saturday | .sunday => true
| _ => false- Setup: add Heron to a Lake project, or use it without project changes, and pick the Heron ref for your Lean version
- Install: the
heroncommand, built from source or from Nix - Editor setup:
heron servein Helix, Neovim and VS Code - Rules: checks and refactors, listing them and turning them off
- Architecture: how the targets, rules, server and release branches fit together
- Style: which code patterns rules use and avoid
- Development: the development environment, adding a rule, running the checks and releasing
Named after the Heron bird that watches over lakes since lake (in turn named after "Lean make") is the name of the build tool for Lean.