ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Bug: comment changed /doc-comment dropped (mli)

Open mbarbin opened this issue 11 months ago • 2 comments

Describe the bug

ocamlformat: Cannot process "lib/miou_vector.mli".
  Please report this bug at https://github.com/ocaml-ppx/ocamlformat/issues.
  BUG: comment changed.
File "_none_", line 1:
Error: doc-comment (**  similar to [top], but with an option instead of an exception  *) dropped.

How to Reproduce Steps to reproduce the behavior:

  • What is the formatted file? Please try to minimize the code snippet. The comment in question is in the file miou_vector.mli. e.g. at revision 01b75212e595d154a0f24387e0fdde8cf86254f2 permalink

To note, this file has a directive at the top of the file to disable ocamlformat:

[@@@ocamlformat "disable"]
...
val top_opt: 'a t -> 'a option
(** similar to [top], but with an option instead of an exception *)
  • What are the selected options?

As specified by the project in .ocamlformat file.

Additional notes

  • This may be a dup of #2585 , however this is in a mli file. Tracking as new issue, you can decide whether to close this one.
  • Listing the file in a local .ocamlformat-ignore file resolve the issue, as an immediate work around.
  • Tried both with ocamlformat 0.26.2 and 0.27.0 - both display the same issue.

mbarbin avatar Jan 05 '25 16:01 mbarbin

Thanks for this extremely well written issue :) This might be related to https://github.com/ocaml-ppx/ocamlformat/issues/2587

Julow avatar Jan 07 '25 14:01 Julow

Hey @Julow very nice hearing from you! Thank you for looking into this issue.

Regarding its phrasing, credit goes back to the team that created the issue template, as I naively followed it as if I was filling out a form. Very pleasing experience! Thanks for this.

mbarbin avatar Jan 07 '25 15:01 mbarbin