tweag / topiary

https://topiary.tweag.io/
MIT License
579 stars 29 forks source link

Inconsistent dangling of `[` and `{` between values and types #730

Closed Niols closed 2 months ago

Niols commented 2 months ago

As of 1720fa963fdf65e9c767edbe02132ccab4078f5a, Topiary formats:

let foo = [
  1;
  2;
  3;
]
;;
type foo = [
  | `A
  | `B
  | `C
]
;;
let bar = {
  a = 1;
  b = 2;
  c = 3;
}
;;
type bar = {
  a : int;
  b : int;
  c : int;
}

as

let foo =
  [
    1;
    2;
    3;
  ]
;;
type foo = [
| `A
| `B
| `C]
;;
let bar =
  {
    a = 1;
    b = 2;
    c = 3;
  }
;;
type bar = {
  a: int;
  b: int;
  c: int;
}

Note how in types the [ and { stay dangling, while in values they move to the next line. This should, I think, be made consistent. I'd vote for the dangling version for everything.