ocurrent / ocaml-ci

A CI for OCaml projects
https://ocaml.ci.dev
111 stars 75 forks source link

Make lint-fmt a no-op when ocamlformat is not configured for a project #937

Closed shonfeder closed 3 months ago

shonfeder commented 3 months ago

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 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.