[CMake] AStyle or similar code beautifier

Marcel Loose loose at astron.nl
Fri Jan 31 09:06:50 EST 2014


On 31/01/14 14:11, Paul Smith wrote:
> On Fri, 2014-01-31 at 02:26 -0800, Alan W. Irwin wrote:
>> And to answer the OP's question, I can highly recommend uncrustify for
>> code styling
> I agree with Alan.  We did a huge reformatting effort last year to
> change a very large C++ codebase from a style based loosely on
> Whitesmith to a more common style.  I started with AStyle which is a
> solid program, but it has limited customization support.
>
> Then I found uncrustify and was quite satisfied with it.  I sent a few
> patches for minor fixes and they were well received.  The main issue
> with uncrustify is that the documentation could be better: for some of
> the more advanced settings it's very hard to understand exactly what
> they control.
That's why I like universalindentgui, a standard Ubuntu package. You can
immediately see what changes will be made to the code when you fiddle
with one of the many settings in uncrustify (assuming it has effect on
the source file you're viewing).
>
> I had to do a bit of scripting around it since uncrustify didn't handle
> all the whitespace conversion we wanted, but it worked great!
>
> We didn't try to integrate it with the build system.  We just checked in
> the configuration file and a script people could use if they wanted to
> re-beautify their code.
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: loose.vcf
Type: text/x-vcard
Size: 292 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140131/f64b9810/attachment.vcf>


More information about the CMake mailing list