Skip to content

Commit

Permalink
Disable warnings when parsing fails
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot committed Mar 20, 2023
1 parent dcbd01a commit 8fabe0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 3 additions & 0 deletions lib/Cmts.ml
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,9 @@ end
module Ocp_indent_compat = struct
let fmt ~fmt_code conf (cmt : Cmt.t) (pos : Cmt.pos) =
let parsed = Docstring.parse ~loc:cmt.loc cmt.txt in
(* Disable warnings when parsing fails *)
let quiet = Conf_t.Elt.make true `Default in
let conf = {conf with Conf.opr_opts= {conf.Conf.opr_opts with quiet}} in
let doc = Fmt_odoc.fmt_parsed conf ~fmt_code ~input:cmt.txt parsed in
let open Fmt in
fmt_if_k
Expand Down
12 changes: 0 additions & 12 deletions test/passing/tests/js_source.ml.err
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
Warning: Invalid documentation comment:
File "tests/js_source.ml", line 3007, characters 27-28:
Stray '@'.
Warning: Invalid documentation comment:
File "tests/js_source.ml", line 3007, characters 28-38:
Unknown tag '@immediate'.
Warning: Invalid documentation comment:
File "tests/js_source.ml", line 3008, characters 29-30:
Stray '@'.
Warning: Invalid documentation comment:
File "tests/js_source.ml", line 3008, characters 30-40:
Unknown tag '@immediate'.
Warning: tests/js_source.ml:155 exceeds the margin
Warning: tests/js_source.ml:3533 exceeds the margin
Warning: tests/js_source.ml:9435 exceeds the margin
Expand Down

0 comments on commit 8fabe0d

Please sign in to comment.