Alignment of multiline doc comments
With --profile=conventional:
(** fooo fooo
fooo *)
let fooo = 1
The item got moved inside a module (it was previously at toplevel). Second line of the docstring did not get indented.
This is fixed by --parse-docstrings but it's not in the conventional profile.
Yes it is due to the wrap-comments=false of this profile that keep the comments unchanged (you may not want the second line indented for whatever reason), if you indent it by hand, you get the expected result.
In that case, the global indentation changed. The second line was correctly aligned, by hand. Should we adjust the indentation in that case ?
What I mean is that, as seen below, the comments are not modified in both cases, but if you indent it manually before formatting like in the second case, the output is what is expected:
module M = struct
(** fooo fooo
fooo *)
let fooo = 1
(** fooo fooo
fooo *)
let fooo = 1
end
I don't think ocamlformat does anything wrong here.
I mean, if you wrap everything in a module (so you need to add a level of indentation) and use ocamlformat to do that for you, the doc comments will not be indented correctly.
(** fooo fooo
fooo *)
let fooo = 1
then
module M = struct
(** fooo fooo
fooo *)
let fooo = 1
end
gives
module M = struct
(** fooo fooo
fooo *)
let fooo = 1
end