When configuring rule RCS1260 (Add/remove trailing comma) using the option "omit_when_single_line", the analyzer emits warnings in the following case:
var foo = new Foo
{
Bar = 1,
};
meaning that the condition used to determine if an object is defined "in a single line" is if there is only one property.
In my opinion, the condition should be that the curly braces are on the same line, in order to produce the following behavior:
// Correct
var foo = new Foo
{
Bar = 1,
};
// Correct
var foo = new Foo { Bar = 1 };
// Warning
var foo = new Foo
{
Bar = 1
};
// Warning
var foo = new Foo { Bar = 1, };
If the current behavior is still desirable for some users, having another option to support the one described above should be enough.
When configuring rule RCS1260 (Add/remove trailing comma) using the option "omit_when_single_line", the analyzer emits warnings in the following case:
meaning that the condition used to determine if an object is defined "in a single line" is if there is only one property.
In my opinion, the condition should be that the curly braces are on the same line, in order to produce the following behavior:
If the current behavior is still desirable for some users, having another option to support the one described above should be enough.