Collection values are normalised
All 14 scenarios hold
Inside a cell, list, set and map values are rewritten with one space after each comma and colon and no spaces directly inside the brackets, recursively through nested collections. Quoted keys keep their quotes.
expected outcome
broken scenario
| Scenario | Value | Formatted? |
|---|---|---|
| Normalize spacing in lists | [1,2,3] | [1, 2, 3] |
| Remove extra spaces inside brackets | [ [] ] | [[]] |
| Format nested lists | [[1,2],[3,4]] | [[1, 2], [3, 4]] |
| Format empty lists | [] | [] |
| Normalize spacing in maps | [a:1,b:2] | [a: 1, b: 2] |
| Format single-quoted keys | ['[a]':1,'b:b':2] | ['[a]': 1, 'b:b': 2] |
| Format double-quoted keys | [",a,":1,"b|b":2] | [",a,": 1, "b|b": 2] |
| Format empty maps | [:] | [:] |
| Normalize spacing in sets | {1,2,3} | {1, 2, 3} |
| Format set with nested list | {[1,2]} | {[1, 2]} |
| Format empty sets | {} | {} |
| Format list of maps | [[a:1],[b:2]] | [[a: 1], [b: 2]] |
| Format nested collections recursively | [a:[1,2],b:[3,4]] | [a: [1, 2], b: [3, 4]] |
| Format deeply nested collections | [a:{[1,2]},b:{[3,4]}] | [a: {[1, 2]}, b: {[3, 4]}] |