1st, lets be clear that bracing style is mostly taste only - that is, if a team decides on a certain taste, who am I to question that (within reason).
The problem is then when you use tools like StyleCop (btw. are there actually any other C# tools like StyleCop? I have the impression its rather singular in the C# ecosystem?)
StyleCop, by default, enforces a certain bracing style, the one in question I found is: CurlyBracketsForMultiLineStatementsMustNotShareLine
, i.e. it enforces
void bla()
{
return x;
}
instead of
void bla() {
return x;
}
The team, however, would really like to stick to the second style.
The question I ask myself is now:
- Can I get Stylecop to validate the other rule, instead of just disabling the rule?
- Are we shooting ourselves in the foot by deviating from the StyleCop recommendation?
Thanks to Patrick:
The style referred to in the question is mostly K&R indentation style and there is a StyleCop issue 6693 that is closed with the message:
So it is simply not supported.