ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
633 stars 179 forks source link

BUG: bad formatting, trailing whitespace #2538

Closed nojb closed 7 months ago

nojb commented 7 months ago
let _ =
  match c with
  | {issuer = _; (* TODO *)
     _
    } -> ()

yields

let _ =
  match c with
  | {
   issuer = _;

   (* TODO *)
 _;
  } ->
      ()

where there is trailing whitespace in the empty line before the (* TODO *). The behaviour can be reproduced with an empty .ocamlformat. Tested on the branch of #2537.

Julow commented 7 months ago

Thanks for reporting, should be fixed by https://github.com/ocaml-ppx/ocamlformat/pull/2540

Julow commented 7 months ago

The fix is merged.