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!
For quite some time, my team has wanted to improve the formatting story for Delphi.
All credit goes to Joshua Gardner and Zane Duffield for delivering such a great formatter.
Yes, I am just trying to work out how to tweak the formatting choices. It puts the begin on the same line as the if statement - a mortal sin at Embarcadero!
I found the .toml file instructions but I am not sure if that’s going to be enough.
It does do an excellent job though.
begin_style [ auto | always_wrap ] (default: auto) Places the beginafter control flow statements (e.g.if). If "always_wrap", the begin will always be placed on the next line at the same indentation as the statement it is within
The above as far as I can see will not indent on the next line of the control flow statement, which is what i would need to use this utility.
No problem with it being opinionated - it’s just that some styles are fairly common like the begin on new lines, and - as you know - lots of development teams are pretty opinionated too!