Custom rule - IF statement format

Sep 8, 2011 at 9:53 PM

Morning,

I'm after a rule that enforces that the branch statements of IF/ELSE are on new lines. For example, instead of:

if (true) DoSomething();
else DoSomethingElse();

it should be:

if (true)
    DoSomething();
else
    DoSomethingElse();

Has anyone written a rule that enforces this (or something similar), or knows of one available? I don't necessarily want to enforce if there's one the true branch, but that isn't a show-stopper.

Cheers,

Daniel B.