ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
622 stars 175 forks source link

BUG: bad formatting, trailing whitespace #2538

Closed nojb closed 5 months ago

nojb commented 5 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 5 months ago

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

Julow commented 5 months ago

The fix is merged.