ocaml-ppx / ocamlformat

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

Bug: formatting did not stabilize after 10 iterations with function attribute, a long comment, and janestreet formatting #2586

Open dbremner opened 1 month ago

dbremner commented 1 month ago

Describe the bug I encountered this issue while formatting a file in one of my projects. It's length dependent and really subtle - adding or removing a character from the comment will cause ocamlformat to format it successfully.

How to Reproduce Steps to reproduce the behavior:

  1. Save the snippet in step 2 to a file, e.g. testcase.ml
  2. Invoke ocamlformat on it ocamlformat testcase.ml using janestreet formatting. let[@warning "-27"] (* Lorem ipsum dolor sit amet, consectetur adipiscing elit, eius *) run root = root
    • What are the selected options?
      profile = janestreet
      version = 0.26.2

Thanks for considering this bug report. Please let me know if there's anything else I can provide.

hhugo commented 3 days ago

2457