[Dune] [#2] Common code-formatting (Attachment added)

Dune flyspray at dune-project.org
Tue May 15 18:46:58 CEST 2012


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#2 - Common code-formatting
User who did this - Felix Albrecht (felixalbrecht)

----------
Dear all,

I would like to add a new flavor to the discussion. Lately I stumbled upon uncrustify [1], which is a command line code formatting tool for various languages. Given a text based config file it can more or less format _every_ aspect of the code (this is, I believe, not an exaggeration! It took us several hours to work through all settings). Such a config file can be crated in a graphical way using the universal indent gui [2]. What I like about these two tools is the following:
* they are available on all platforms, open source and free
* the configuration lies in a text file, which can be easily distributed
* the configuration covers every possible aspect (once agreed upon everyone can infer the settings for their editors)
* uncrustify can be integrated into most editors (if only by defining an external tool and assigning a shortcut) and version control systems

Given such a config file, users can adapt their editors to comply with the config file (or use uncrustify directly). One could even implement uncrustify as a post-commit hook to check if commited files comply with he coding standard (if wished). I do not care that much about the actual configuration but I think it would just be great to have.

If you want to play around with uncrustify I recommend getting your hands on a recent version of both uncrustify and the universal indent gui. I also append a sample config file to play with (not a suggestion for an actual configuration!). Be sure to run uncrustify with '-l CPP', since it would otherwise interpret .hh files as C code: 'uncrustify -l CPP -c sample.cfg --replace *.hh'

I do thus ask for opinions and, if there was general agreement, would be willing to create a first configuration file base on past discussions and try to moderate an agreement upon a configuration.

[1]: http://uncrustify.sourceforge.net/
[2]: http://universalindent.sourceforge.net/
----------

One or more files have been attached.

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=2#comment3518

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list