[Dune] [#2] Common code-formatting

Dune dune at dune-project.org
Tue Sep 29 16:14:30 CEST 2009


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 - Carsten Gräser (Carsten)

----------
Banning <tab> would be nice. I also think that the number of spaces is a minor issue, same holds for the place of opening braces. As suggested one could fix the tab-width with mode lines and furthermore replace them if one does a code change.

So I suggest the following rules:

1. Don't use tabs anymore !
2. Add modelines that ban tabs and prescribe an indentation width to every new file and every file you change.
3. For old files: Try to examine the 'mostly used width' for the added mode line.
4. If there is no 'mostly used width' use X.
5. If you change or add code: Follow the indentation rule prescribed by the modeline.
6. Don't indent line that shouldn't be indentend.
7. Indent all lines that should be indented.
8. You may violate 5.-7. for good reason but not for laziness.

Rule 4 would be the fall back for the very chaotic sources. Jö suggested X=2, I'd prefer X=4 but any choice Xin{2,4} would be fine for me. Perhaps we can also agree that lines with opening/closing braces are covered by rule 6 (opposed to the GNU style).

These rules are not to invasive and might help to improve code formating in the future. Perhaps we should add a template for the modelines to the coding style page where one might adapt the width for old files.


----------

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

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