You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a problem with the quiet option (which is kind of necessary as long as we are using deprecated options) in case of formatting error as it shows absolutely no details and just exits with code 1. I think that it would be better if errors were always displayed or if quiet could be configured to select what to hide.
When a file can't be compiled because it has an invalid syntax it is a problem but it is reduced by the fact that the ocaml compiler will tell us exactly what happens. When a file is valid ocaml but contains something that ocamlformat is unhappy with it becomes hard to understand the situation.
opam exec -- dune build @fmt --auto-promote
Entering directory '/home/louis.roche/Code/ahrefs/repo/backend'
File "dune-project", line 3, characters 0-40:
3 | (formatting
4 | (enabled_for ocaml reason))
Warning: option `break-cases`: value `toplevel` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: break-struct: This option is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: option `indicate-multiline-delimiters`: value `closing-on-separate-line` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: nested-match: This option is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: option `module-item-spacing`: value `preserve` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: option `break-cases`: value `toplevel` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: break-struct: This option is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: option `indicate-multiline-delimiters`: value `closing-on-separate-line` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: nested-match: This option is deprecated since version 0.20.0. It will be removed by version 1.0.0.
Warning: option `module-item-spacing`: value `preserve` is deprecated since version 0.20.0. It will be removed by version 1.0.0.
ocamlformat: ignoring "api/src/api.ml" (misplaced documentation comments - warning 50)
File "api/src/api.ml", line 37, characters 0-14:
37 | (** foo bar *)
^^^^^^^^^^^^^^
Warning 50 [unexpected-docstring]: ambiguous documentation comment
Hint: (Warning 50) This file contains a documentation comment (** ... *) that the OCaml compiler does not know how to attach to the AST. OCamlformat does not support these cases. You can find more information at: https://github.com/ocaml-ppx/ocamlformat#overview. If you'd like to disable this check and let ocamlformat make a choice (though it might not be consistent with the ocaml compilers and odoc), you can set the --no-comment-check option.
I can't change the labels, but this issue should then be a feature request.
Khady
changed the title
Bug: quiet option hides errors in addition to warnings
Feature request: quiet option hides errors in addition to warnings
May 19, 2022
Describe the bug
We have a problem with the quiet option (which is kind of necessary as long as we are using deprecated options) in case of formatting error as it shows absolutely no details and just exits with code 1. I think that it would be better if errors were always displayed or if quiet could be configured to select what to hide.
When a file can't be compiled because it has an invalid syntax it is a problem but it is reduced by the fact that the ocaml compiler will tell us exactly what happens. When a file is valid ocaml but contains something that ocamlformat is unhappy with it becomes hard to understand the situation.
How to Reproduce
example 1
without quiet the problem is clear
with quiet we are left in the dark
The text was updated successfully, but these errors were encountered: