ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Docstring parsing fails with [@@@ocamlformat "disable"]

Open Ngoguey42 opened this issue 5 years ago • 2 comments

How to Reproduce Running

ocamlformat foo.ml --inplace

on this file

[@@@ocamlformat "disable"]

(** hello *)
let foo = 42

produces this error

ocamlformat: Cannot process "foo.ml".
  Please report this bug at https://github.com/ocaml-ppx/ocamlformat/issues.
  BUG: doc comments changed.
File "_none_", line 1:
Error: Formatting of (** hello *) is unstable (e.g. parses as a list or not depending on the margin), please tighten up this comment in the source or disable the formatting using the option --no-parse-docstrings.

when using ocamlformat 0.15.0.

Ngoguey42 avatar Nov 17 '20 11:11 Ngoguey42

Hi, I was curious if using the .ocamlformat-ignore would work for you instead of the [@@@ocamlformat "disable"] attribute?

gpetiot avatar Nov 25 '20 12:11 gpetiot

Hi, Yes it would work.

Ngoguey42 avatar Nov 25 '20 12:11 Ngoguey42