| 40 columns | |
| >>> parameters fit but ) does not |
| method(int firstArgument, int argumentTo) { |
| print('42'); |
| } |
| <<< |
| method( |
| int firstArgument, int argumentTo) { |
| print('42'); |
| } |
| >>> parameters fit but } does not |
| method(int firstArgument, int argument) { |
| print('42'); |
| } |
| <<< |
| method( |
| int firstArgument, int argument) { |
| print('42'); |
| } |
| >>> many parameters |
| method(int first, int second, int third, int fourth, int fifth, int sixth, |
| int seventh, int eighth, int ninth, int tenth, int eleventh, int twelfth) { |
| print('42'); |
| } |
| <<< |
| method(int first, int second, int third, |
| int fourth, int fifth, int sixth, |
| int seventh, int eighth, int ninth, |
| int tenth, int eleventh, |
| int twelfth) { |
| print('42'); |
| } |
| >>> no split after "(" in lambda |
| var meth = ( |
| int firstArgument, int argument) { |
| print('42'); |
| }; |
| <<< |
| var meth = (int firstArgument, |
| int argument) { |
| print('42'); |
| }; |
| >>> keep mandatory and positional on same line |
| foo(param, [foo, bar]) {} |
| <<< |
| foo(param, [foo, bar]) {} |
| >>> keep mandatory and named on same line |
| foo(param, {foo, bar}) {} |
| <<< |
| foo(param, {foo, bar}) {} |
| >>> move just optional positional to second line even though all fit on second |
| reallyLongMethod(parameter, [foo, bar]) {} |
| <<< |
| reallyLongMethod(parameter, |
| [foo, bar]) {} |
| >>> move just named to second line even though all fit on second |
| reallyLongMethod(parameter, {foo, bar}) {} |
| <<< |
| reallyLongMethod(parameter, |
| {foo, bar}) {} |
| >>> avoid splitting in function type parameters |
| bool doStuff(parameter1, void printFn(param1, param2)) {} |
| <<< |
| bool doStuff(parameter1, |
| void printFn(param1, param2)) {} |
| >>> |
| doStuff(param1, void printFn(param1, param2)) {} |
| <<< |
| doStuff(param1, |
| void printFn(param1, param2)) {} |
| >>> allow splitting in function type parameters |
| doStuff(callback(parameter1, parameter2, parameter3, parameter4)) {} |
| <<< |
| doStuff(callback(parameter1, parameter2, |
| parameter3, parameter4)) {} |