We're excited to share the first public release of pasfmt, a free and open-source code formatter for Delphi.
It is a complete and opinionated formatting tool.
The latest release has support for:
Complete line wrapping (and unwrapping) for all Delphi structures
Configurable line length limit
Removing trailing whitespace
Change spacing around all tokens (e.g., operators and keywords)
Parallel file formatting with directory traversal
Removing repeated empty newlines
Line ending normalisation
To get started, either try our web demo, or download the executable (this one for Windows) and follow the getting started guide.
Additionally, there is an IDE plugin with support for:
In-editor formatting
Format-on-save
Cursor tracking
You may be wondering how this tool compares to the existing formatters (e.g., GExperts, JEDI, Formatter.exe).
This tool goes a lot further than the alternatives by having a complete opinion on how every line should be wrapped or unwrapped; the original layout is (almost) ignored.
By ignoring most of the input format, it produces consistently styled code across a whole codebase.
We hope that you enjoy pasfmt, let us know what you think!