Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Preferably a tool which will run from inside of the Delphi IDE (I use Delphi 7), but I can accept a standalone program.

Should have the ability to define rules (X space indent, no tabs, one statement per line, etc, etc (perhaps capitalization rules too?))

Nice if it can handle an entire directory or project at one touch, rather than just a single file.


share|improve this question

closed as off-topic by gnat, GrandmasterB, MichaelT, Snowman, durron597 Jun 30 at 3:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, GrandmasterB, MichaelT, Snowman, durron597
If this question can be reworded to fit the rules in the help center, please edit the question.

This is fine in single-developer projects, but in multi-developer projects, or even projects where reading clear concise history (diffs) for your versions is important to you, consider NOT "beautifying" any code you aren't modifying right now. Whitespace-Noise will destroy the signal in your version history. You can't entirely ignore whitespace unless you implement a Delphi grammar aware diff tool. If you like me, would be loathe to have some change you made hidden among thousands of noise-lines of reformatting and whitespace changes, you might rethink this. –  Warren P Nov 20 '14 at 15:35
Btw, we now have a site for recommending s/w tools, such as this. See softwarerecs.stackexchange.com –  Mawg Jun 25 at 10:51

2 Answers 2

up vote 6 down vote accepted

The Jedi Code Formatter (JCF) is the best I've found. There are a couple of plugins for Delphi 7, the Delphi Formatting Expert (DelForExp) which is also available as a plug-in for GExperts.

The JCF is more configurable, but the GExperts addin is more convenient for me because I have GExperts installed. It's flexible enough to cater for my needs. It has "all open files" and "whole project" modes, but that has the usual problem of ignoring anything not listed in your dpr file.

share|improve this answer
+1 and the answer. Either one of those will work for me. Thanks –  Mawg May 16 '11 at 5:11

There is a delphi code formatter built into Delphi XE, also. It can not handle the entire directory in one go. You simply hit Ctrl+D when you want to reformat the unit in the editor.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.