blob: 75f722c418e4a536b4b65f0390ab9e9e538db558 [file] [log] [blame]
40 columns |
>>> split in condition
var set = {1, if (veryLongConditionExpression || anotherPart) 2};
<<<
var set = {
1,
if (veryLongConditionExpression ||
anotherPart)
2
};
>>> without else on one line
var set = {1, if (c) 2, 3};
<<<
var set = {1, if (c) 2, 3};
>>> with else on one line
var set = {1, if (c) 2 else 2, 3};
<<<
var set = {1, if (c) 2 else 2, 3};
>>> split collection before if
var set = {if (c) somewhatLongThingHere};
<<<
var set = {
if (c) somewhatLongThingHere
};
>>> one line in multi-line
var set = {veryLongThingThatForcesASplit, if (c) 2, 3};
<<<
var set = {
veryLongThingThatForcesASplit,
if (c) 2,
3
};
>>> one line in multi-line with else
var set = {veryLongThingThatForcesASplit, if (c) 2 else 2, 3};
<<<
var set = {
veryLongThingThatForcesASplit,
if (c) 2 else 2,
3
};
>>> long then branch forces split
var set = {1, if (condition) veryLongThingThatForcesASplit, 3};
<<<
var set = {
1,
if (condition)
veryLongThingThatForcesASplit,
3
};
>>> long then branch forces both to split
var set = {1, if (condition) veryLongThingThatForcesASplit else 2, 3};
<<<
var set = {
1,
if (condition)
veryLongThingThatForcesASplit
else
2,
3
};
>>> long else branch forces both to split
var set = {1, if (condition) 2 else veryLongThingThatForcesASplit, 3};
<<<
var set = {
1,
if (condition)
2
else
veryLongThingThatForcesASplit,
3
};
>>> trailing comma
var set = {if (c) 2,};
<<<
var set = {
if (c) 2,
};
>>> spread list inside if stays on one line if it fits
var set = {if (c) ...{1, 2}};
<<<
var set = {
if (c) ...{1, 2}
};
>>> spread list inside if formats like block if it splits
var set = {if (c) ...{1, 2,}};
<<<
var set = {
if (c) ...{
1,
2,
}
};
>>> both spreads split if then must
var set = {if (c) ...{1, 2,} else ...{1, 2}};
<<<
var set = {
if (c) ...{
1,
2,
} else ...{
1,
2
}
};
>>> both spreads split if else must
var set = {if (c) ...{1, 2} else ...{1, 2,}};
<<<
var set = {
if (c) ...{
1,
2
} else ...{
1,
2,
}
};
>>> a split collection that isn't spread wraps and indents
var set = {if (c) {1,2,}};
<<<
var set = {
if (c)
{
1,
2,
}
};
>>> a split collection that isn't spread wraps and indents
var set = {if (c) {1,2,} else thing};
<<<
var set = {
if (c)
{
1,
2,
}
else
thing
};
>>> a split collection that isn't spread wraps and indents
var set = {if (c) thing else {1,2,}};
<<<
var set = {
if (c)
thing
else
{
1,
2,
}
};
>>> lambda inside then
var set = {if (c) () { body; }};
<<<
var set = {
if (c)
() {
body;
}
};
>>> lambda inside else
var set = {if (c) thing else () { body; }};
<<<
var set = {
if (c)
thing
else
() {
body;
}
};
>>> nested if splits outer
var set = {if (c) if (d) thing};
<<<
var set = {
if (c)
if (d) thing
};
>>> split collection before body
var set = {if (c) longThingHereThatIsLong};
<<<
var set = {
if (c) longThingHereThatIsLong
};
>>> just split outer if
var set = {if (condition) if (another) longThingHereThatIsLong};
<<<
var set = {
if (condition)
if (another) longThingHereThatIsLong
};
>>> split inside condition
var set = {if (veryLongCondition + thatNeedsToSplit) thing};
<<<
var set = {
if (veryLongCondition +
thatNeedsToSplit)
thing
};