Skip to content

Bug: verbatim comment formatting not respected #1132

@ceastlund

Description

@ceastlund

Describe the bug
If I format this code (with a formatted comment, taken from array.ml in Base)...

let _ =
  (* Optimal 5-element sorting network:

     {v
        1--o-----o-----o--------------1
           |     |     |
        2--o-----|--o--|-----o--o-----2
                 |  |  |     |  |
        3--------o--o--|--o--|--o-----3
                       |  |  |
        4-----o--------o--o--|-----o--4
              |              |     |
        5-----o--------------o-----o--5
      v} *)
  ()
;;

...ocamlformat reindents the formatted comment like this:

let _ =
  (* Optimal 5-element sorting network:

     {v
     1--o-----o-----o--------------1
     |     |     |
     2--o-----|--o--|-----o--o-----2
     |  |  |     |  |
     3--------o--o--|--o--|--o-----3
     |  |  |
     4-----o--------o--o--|-----o--4
     |              |     |
     5-----o--------------o-----o--5
     v} *)
  ()
;;

How to Reproduce
Run ocamlformat built from bcb803e with --profile=janestreet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions