Skip to content

Bug: Unwanted trailing whitespace with break-cases=all #1001

@Wilfred

Description

@Wilfred

Describe the bug
break-cases=all results in blank lines that contain whitespace.

How to Reproduce

Given the code:

let handler =
  object
    method at_expr x =
      match x with
      | Call Thing
      (* isset($var::thing) but not isset($foo::$bar) *)

       |Call OtherThing ->
          Errors.isset_in_strict p
      | _ -> ()
  end

ocamlformat --enable-outside-detected-project --break-cases=all -i ~/tmp/foo.ml produces:

let handler =
  object
    method at_expr x =
      match x with
      | Call Thing
      (* isset($var::thing) but not isset($foo::$bar) *)
      
       |Call OtherThing ->
          Errors.isset_in_strict p
      | _ -> ()
  end

Note that the blank line has 6 spaces on it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions