Package org.ek9lang.compiler.formatter


package org.ek9lang.compiler.formatter
EK9 Canonical Source Formatter.

Zero-configuration formatter that enforces a single canonical style for all EK9 code. Inspired by gofmt and Black: no options, no debates, one format everywhere.

Key properties:

  • Idempotent: Running twice produces the same output as running once.
  • Deterministic: Same input always produces the same output.
  • Safe by default: Refuses to modify unparseable files without force flag.
  • Parser-validated: Every transformation is validated by re-parsing.
  • Never corrupts: Original file preserved if any pass produces unparseable output.

The formatter uses a four-pass Tier 1 pipeline for parseable files and a three-phase Tier 2 pipeline for force-formatting unparseable files.

See Also: