Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: (optionally) exit with error on bad doc comments #1448

Open
jvillard opened this issue Aug 17, 2020 · 1 comment
Open

Feature request: (optionally) exit with error on bad doc comments #1448

jvillard opened this issue Aug 17, 2020 · 1 comment

Comments

@jvillard
Copy link

When a bad doc comment is encountered, ocamlformat prints a warning, gives up on the comment, and exits with code 0 (success). It would be nice to have the option in ocamlformat to fail with an error code in that case, for instance to more easily keep a code base clean of errors in doc comments, especially as ocamlc won't complain about ill-formed doc comments either, although ocamldoc will.

Repro with ocamlformat version 0.14.1-13-g000da99:

$ echo '(** [ *)' | ocamlformat --impl -
Warning: Invalid documentation comment:
File "<standard input>", line 1, characters 6-6:
End of text is not allowed in '[...]' (code).
(** [ *)
$ echo $?
0
@gpetiot
Copy link
Collaborator

gpetiot commented Aug 27, 2020

Maybe we could use a --strict option for ocamlformat that would treat all warnings as errors, not limited the the docstring warnings. Already discussed with @jberdine in #1388 although it was not really the source of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants