views:

337

answers:

12

We all know that deadlines and/or critical bugfixes and make us forget a bit about source formatting guidelines. Or sometimes you need to work with 3rd party source code which seems to have been coded by someone who doesn't know the meaning of whitespace and readability. What is your favorite tool to tabulate your code (or 3rd party code) to your specification?

A: 

For Delphi I like Delforexp. Simple and quite fast.

Gamecat
I absolutely cannot get this to work in Delphi 2007. I install it and it seems fine until I try to use it. I then spend about 30 minutes trying to close all the exceptions before it finally causes Delphi to close. :(
John Kraft
Hm have not tried it on 2007. But if I magage to get it to work I let you know.
Gamecat
A: 

My IDE, IntelliJ, does this while I check in or with a keystroke.

Eric Wendelin
A: 

Perl is the language I use most, and perltidy does a great job.

douglashunter
+2  A: 

Resharper's built in tool is pretty awesome.

John Kraft
+2  A: 

I like Visual Studio's autoformat feature. It's all mass-market and The Man's Tool, but hey, it works & I can read their formatting.

Paul Nathan
A: 

I personally use PolyStyle as it supports many, many languages, but I'm curious about alternatives, hence the question.

Andrew Moore
A: 

One can also use Uncrustify and the UniversalIndentGUI, also good for mass tagging.

hangy
A: 

Emacs:

C-x h (select all)

C-M-\ (indent region)

paradoja
A: 

HTMLtidy is great for HTML formatting.

Dan Walker
A: 

Heard good things about Artistic Style.

David Grant
A: 

My favorite tool is indent. It is available off-the shelf in most Unix distributions. It has tens of options to accommodate most C style conventions. On Windows it can be easily installed through Cygwin. Having said that, automated code formatting should be your last resort. No tool can format code as well as a good programmer.

Diomidis Spinellis
A: 

Python itself.... and a vote for Resharper

jle