F# source code formatter. Parses F# to an untyped AST (via vendored FCS), transforms it to an intermediate representation called Oak (SyntaxOak.fs), then prints it back via writer events (CodePrinter.fs + Context.fs).
dotnet build fantomas.sln
dotnet test src/Fantomas.Core.Tests/All scripts accept a file path or stdin, with optional --signature and --editorconfig <content> flags.
scripts/ast.fsx— untyped ASTscripts/oak.fsx— Oak treescripts/format.fsx— format with local buildscripts/writer-events.fsx— writer events produced during formatting
Scripts require a debug build first (dotnet build src/Fantomas/Fantomas.fsproj).
Run these after completing a task, not during iterative development — analyzers can be slow.
dotnet fantomas src docs build.fsxdotnet fsi build.fsx -- -p AnalyzeOutput goes to analysis.sarif in the repo root.