On Saturday, 14 March 2015 at 23:15:35 UTC, Brian Schott wrote:
First, a disclaimer: I am an idiot for starting this thread.

Moving on...

I'm working on a list of configuration options for dfmt - a formatter for D source code.

So far I have the following:

* Insert spaces between if, while, for, foreach, etc loops and the "(" * Allman vs One True Brace Style (Already supported by commant-line switch) * Operators at the end of the old line vs beginning of the new line when wrapping long expressions.
* Insert space after the ")" of a cast expression
* Make "case" and "default" match the indent level of the enclosing "switch" * Labels for loops always on their own line vs the same line as the loop
* Labels outdented one level
* Label indentation matches the most recent "switch"
* Hard limit for line length
* Soft limit for line length

What am I missing?

First of all look at AStyle. It has plenty of options.

And There are some D specific options: templates constraints, function contract, static if (I would prefer do not ident code in static if block, for example).

Actually I with my student work also on code formatter, but we go deeper (may be too deeper :) ), unfortunately we haven't much time. And we wish you good luck with dfmt!!!

Reply via email to