The gist is that dune build @fmt currently exits with 1 if ocamlformat is not installed. So this change makes the fmt-lint job a no-op in case the project is not configured for ocamlformat.
An alternative approach would be to install ocmalformat unconditionally, but that seemed a bit iffy to me, as it takes extra resources and I thought it may produce failing outcomes that devs weren't expecting? I'm happy to go that route of others think it is preferable tho.
Once dune build @fmt allows clean exits even when ocamlformat is not installed, we should undo this change, so that we still have the benefit of running other formatting lints that may be associated with the @fmt alias.
Closes #936
This is a workaround for https://github.com/ocaml/dune/issues/10578 .
The gist is that
dune build @fmt
currently exits with 1 if ocamlformat is not installed. So this change makes thefmt-lint
job a no-op in case the project is not configured for ocamlformat.An alternative approach would be to install ocmalformat unconditionally, but that seemed a bit iffy to me, as it takes extra resources and I thought it may produce failing outcomes that devs weren't expecting? I'm happy to go that route of others think it is preferable tho.
Once
dune build @fmt
allows clean exits even when ocamlformat is not installed, we should undo this change, so that we still have the benefit of running other formatting lints that may be associated with the@fmt
alias.