Know of any good free beautifiers (pretty printers)?
There are some free command line programs, but I'd like something with a gui. While not essential, it is helpful and even more so if it could automatically find unmatched braces and parentheses. My editor only does this when the cursor is next to the symbol in question.
Re: Know of any good free beautifiers (pretty printers)?
What are you looking to beautify? If it's C++ code, then most IDEs (e.g. eclipse, Visual Studio) have a "Format" feature that formats the code according to conventions that you can (usually) customize.
Re: Know of any good free beautifiers (pretty printers)?
I have vs 2008 express. I can't find that feature. It also doesn't check matching braces et al.
Re: Know of any good free beautifiers (pretty printers)?
I'm not a VS user, but a quick google search reveals that it's under Edit->Advanced->Format Document.
Re: Know of any good free beautifiers (pretty printers)?
I meant it's not available in my version for some reason since it's not where I'd expect it to be - where you specified.
Re: Know of any good free beautifiers (pretty printers)?
I've been using Uncrustify for some time. I've very slightly modified the code to give the formating I require that I couldn't get from the extensive configuration parameters.
It has been written to beautify several different languages including C++. It does seem to have a bit of a problem with formatting templates sometimes, but it never breaks the code.
Re: Know of any good free beautifiers (pretty printers)?
I found universal indent gui which has extensive options but with poor presentation. The names of options are barely descriptive; and I think the purpose of a frontend is to convert the minimalistic command line options of backends into more descriptive labels. When considering dozens of options I have to hover over most of them to get a clue, and some tools have a small example script in a tiny, hard to make out font, that doesn't really help with efficient understanding of the option's purpose. The lack of consistency among tools prompts me to wonder which tool is the best for c++, though it seems the one you mentioned has the most versatile options. I still can't find an option to join the lines of an if statement with only one sub-statement and delete the braces if present. I also wonder why the gui doesn't use the latest versions of the backend tools.
Perhaps a few regex manipulations would achieve the desired results, but it would be so great if beautification was simplified to a few, easy to understand menus.
Re: Know of any good free beautifiers (pretty printers)?
Quote:
Originally Posted by
cbv
Perhaps a few regex manipulations would achieve the desired results,
I would be nice if you could, but I suspect the complex rules for C++ syntax, where the meanings of symbols depend on context, would make the job near impossible.
I haven't managed to get uncrustify to do exactly what I would like, but it does a reasonable job and I can put up with the occasional odd layout (with templates mostly).