One formatter. Command line, settings editor and IDE.
YADF (Yet Another Delphi Formatter) reformats .pas, .dpr, .dpk and .inc source by a rule set you configure: line-length budgeting, structural re-indentation, capitalization and column alignment.
One engine drives the command-line tool, a live-preview settings editor and a Delphi IDE package, from the same settings files. Formatting is idempotent: formatting formatted code changes nothing. A content guard checks every result against its input, and malformed source does not crash it.
Set it once, format everywhere
What it does
Format in the IDE
Ctrl+Shift+Alt+F formats the current buffer with your F profile, Ctrl+Shift+Alt+R with your R profile. No restart.
Line length you choose
Full reflow: joins lines that fit, breaks lines that overflow, one item per line in uses clauses and argument lists.
Smart column alignment
Lines up : in declarations, = in const blocks, := and trailing comments, keeping columns tight.
Structural re-indent
Sections, classes and records, begin/end, case/try, loop bodies, else-if chains.
Consistent capitalization
Lowercase keywords, upper-case hex digits and directive names, consistent identifier casing.
Safe by design
Idempotent output, a content guard on every result, optional backups, --check round-trip, fixed exit codes; the original is never lost if a save fails.
Live settings editor
YADFSetup: Settings | Source | Result, re-formatting as you change a setting.
Profiles and a profile catalog
Two active profiles: F for the main shortcut and the CLI, R for a second shortcut. Keep any number of saved profiles and assign them with Set F / Set R on the IDE Options page (Tools > Options > Third Party > YADF), with a live before/after preview. Changes apply on the next format, no restart.
Delphi 10 downgrade (experimental)
Moves inline var declarations into a classic var block so code from 11-13 can build on 10.2.3. Best effort: ambiguous cases are left marked for you to finish.
Embarcadero RAD Studio and the command line
YADFOT plugin, Win32 and Win64 packages; Help > Tools > YADFOT: Format Current Buffer.
YADF.exe, Win64, no Delphi installation needed.
YADFSetup.exe, Win64.
VS Code and other editors; Linux, macOS.
Formats Micronite every day
Like DL, YADF grew out of the development of HTR Micronite, our quality and production-control software for manufacturers.