Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Error code of dune format should be non zero when it fails

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Mar 7, 2019
1 parent 5fc11f0 commit 9ab7660
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ unreleased
- Fix generation of `.merlin` files on Windows. `\` characters needed
to be escaped (#1869, @mlasson)

- Fix 0 error code when `$ dune format` fails. (#1915, fix #1912, @rgrinberg)

This comment has been minimized.

Copy link
@aalekseyev

aalekseyev Mar 7, 2019

ocaml#1912 seems wrong?

This comment has been minimized.

Copy link
@rgrinberg

rgrinberg Mar 7, 2019

Author Owner

Indeed. I fixed it.


1.7.3 (unreleased)
------------------

Expand Down
5 changes: 3 additions & 2 deletions src/format_dune_lang.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ let pp_top_sexps =
let format_file ~input =
match parse_file input with
| exception Dune_lang.Parse_error e ->
Printf.printf
Printf.eprintf
"Parse error: %s\n"
(Dune_lang.Parse_error.message e)
(Dune_lang.Parse_error.message e);
exit 1
| OCaml_syntax loc ->
Errors.warn loc "OCaml syntax is not supported, skipping."
| Sexps sexps ->
Expand Down

0 comments on commit 9ab7660

Please sign in to comment.