OLD | NEW |
(Empty) | |
| 1 40 columns | |
| 2 >>> empty list |
| 3 []; |
| 4 <<< |
| 5 []; |
| 6 >>> exactly 40 characters |
| 7 [first, second, third, fourth, seventh]; |
| 8 <<< |
| 9 [first, second, third, fourth, seventh]; |
| 10 >>> |
| 11 [first, second, third, fourth, fifth, sixth]; |
| 12 <<< |
| 13 [ |
| 14 first, |
| 15 second, |
| 16 third, |
| 17 fourth, |
| 18 fifth, |
| 19 sixth |
| 20 ]; |
| 21 >>> splits outer lists even if they fit |
| 22 [[first], [], [ |
| 23 second,[third], fourth] ]; |
| 24 <<< |
| 25 [ |
| 26 [first], |
| 27 [], |
| 28 [ |
| 29 second, |
| 30 [third], |
| 31 fourth |
| 32 ] |
| 33 ]; |
| 34 >>> split indirect outer |
| 35 [function([inner])]; |
| 36 <<< |
| 37 [ |
| 38 function([inner]) |
| 39 ]; |
| 40 >>> empty literal does not force outer split |
| 41 [[], {}, () {}]; |
| 42 <<< |
| 43 [[], {}, () {}]; |
| 44 >>> nested split list |
| 45 [first, [second, third, fourth], fifth, [sixth, seventh, eighth, nine, tenth, |
| 46 eleventh]]; |
| 47 <<< |
| 48 [ |
| 49 first, |
| 50 [second, third, fourth], |
| 51 fifth, |
| 52 [ |
| 53 sixth, |
| 54 seventh, |
| 55 eighth, |
| 56 nine, |
| 57 tenth, |
| 58 eleventh |
| 59 ] |
| 60 ]; |
| 61 >>> force multi-line because of contained block |
| 62 [first, () {"fn";},third,fourth]; |
| 63 <<< |
| 64 [ |
| 65 first, |
| 66 () { |
| 67 "fn"; |
| 68 }, |
| 69 third, |
| 70 fourth |
| 71 ]; |
| 72 >>> spaces between items |
| 73 [1,2,3,4]; |
| 74 <<< |
| 75 [1, 2, 3, 4]; |
| 76 >>> dangling comma |
| 77 [1 , ]; |
| 78 <<< |
| 79 [1,]; |
| 80 >>> dangling comma multiline |
| 81 [first, second, third, fourth, fifth, sixth , ]; |
| 82 <<< |
| 83 [ |
| 84 first, |
| 85 second, |
| 86 third, |
| 87 fourth, |
| 88 fifth, |
| 89 sixth, |
| 90 ]; |
| 91 >>> nested lists are forced to split |
| 92 [[[[[argument, argument, argument, argument]]]]]; |
| 93 <<< |
| 94 [ |
| 95 [ |
| 96 [ |
| 97 [ |
| 98 [ |
| 99 argument, |
| 100 argument, |
| 101 argument, |
| 102 argument |
| 103 ] |
| 104 ] |
| 105 ] |
| 106 ] |
| 107 ]; |
| 108 >>> preserve newlines in lists containing a line comment |
| 109 [ |
| 110 // yeah |
| 111 a,b,c, |
| 112 d,e,f, |
| 113 ]; |
| 114 <<< |
| 115 [ |
| 116 // yeah |
| 117 a, b, c, |
| 118 d, e, f, |
| 119 ]; |
| 120 >>> wrap between elements even when newlines are preserved |
| 121 [ |
| 122 // yes |
| 123 longElement,longElement,longElement,longElement, |
| 124 longElement,longElement,longElement,longElement,longElement,longElement, |
| 125 ]; |
| 126 <<< |
| 127 [ |
| 128 // yes |
| 129 longElement, longElement, longElement, |
| 130 longElement, |
| 131 longElement, longElement, longElement, |
| 132 longElement, longElement, longElement, |
| 133 ]; |
| 134 >>> ignore line comment after the "]" |
| 135 [ |
| 136 a,b,c, |
| 137 d |
| 138 ] // comment |
| 139 ; |
| 140 <<< |
| 141 [a, b, c, d] // comment |
| 142 ; |
| 143 >>> preserves one blank line between elements |
| 144 [ |
| 145 |
| 146 |
| 147 element, |
| 148 |
| 149 |
| 150 |
| 151 // comment |
| 152 element, |
| 153 |
| 154 |
| 155 |
| 156 element |
| 157 |
| 158 |
| 159 ]; |
| 160 <<< |
| 161 [ |
| 162 element, |
| 163 |
| 164 // comment |
| 165 element, |
| 166 |
| 167 element |
| 168 ]; |
OLD | NEW |