dfmt options

Shammah Chancellor via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 27 08:30:52 PDT 2015


On 2015-03-14 23:15:34 +0000, Brian Schott said:

> 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?

A way to configure this and have it look for the most relevant 
`.dfmtcfg` file! :)

That is to say, make it look up from the current directory recursively 
until it finds a config file, and use that.    This will greatly help 
people who are contributing to the same project keep a consistent 
format.  Also,  Hard and soft limit for line length causes an exception 
to be thrown when I tried it.

-Shammah



More information about the Digitalmars-d mailing list