Closed hannesm closed 3 months ago
Thanks for the report! The fix in #937 proposes making the lint-fmt
job a no-op when the repo isn't configured for ocamlformat. The other option is to always install ocamlformat in that job and still run dune build @fmt
. If you have an opinion one way or the other, I'd be happy to hear it.
Thanks for your reply, @shonfeder. I don't quite know. What is the lint-fmt
check supposed to do, in general? Is it only a ocamlformat check? I also don't quite understand what dune build @fmt
is supposed to do, since there's quite a bit of configuration, namely: is .ocamlformat
present? does dune-project
contain a (formatting disabled)
line (and than, this as well depends on the dune lang version). I'm also not sure whether this changed in recent times.
What is the
lint-fmt
check supposed to do, in general? Is it only a ocamlformat check? I also don't quite understand whatdune build @fmt
is supposed to do, since there's quite a bit of configuration, namely: is.ocamlformat
present? doesdune-project
contain a(formatting disabled)
line (and than, this as well depends on the dune lang version). I'm also not sure whether this changed in recent times.
Generally, afaiu, dune build @fmt
causes all actions associated with the fmt
alias to be built, and these may include custom rules. However, there are a default set of actions associated. As per https://dune.readthedocs.io/en/stable/howto/formatting.html#setting-up-the-environment, three kinds of formatting and configurable by default:
refmt
for Reason codeocamlformat
for OCaml codeSo one may want to run dune build @fmt
to format dune files, without having to install ocamlformat
, and imo it seems clearly to be an error that this is not currently supported (when .ml
files are present). While that is waiting on a fix, however, one of the two alternatives I've proposed should keep the CI job from failing :)
Context
Take a look at the run in https://ocaml.ci.dev/github/robur-coop/caldav/commit/d0d7294ad7f725629877be711249517541260ae8/variant/%28lint-fmt%29 (full output below)
The repository where this is running on is https://github.com/robur-coop/caldav
Expected behaviour
It should succeed.
Technical details
There's no .ocamlformat file in the repository, there's as well no "(formatting disabled)" in dune-project.