ocurrent / ocaml-ci

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

fix(lint-fmt): do not fail on generated files #909

Closed edwintorok closed 8 months ago

edwintorok commented 8 months ago

In 1 lint-fmt failed because of missing dependencies:

File "bin/dune", line 6, characters 43-49:
6 |  (libraries dune-site.plugins cmdliner fmt gospel registration))
                                               ^^^^^^
Error: Library "gospel" not found.
-> required by _build/default/bin/cli.exe
-> required by _build/install/default/bin/ortac
-> required by _build/default/examples/lwt_dllist_tests.ml
-> required by alias examples/.formatted/fmt
-> required by alias examples/fmt

Dune was trying to build the generated file, however that is not really necessary (there is one in the build tree already), so we should instead ask dune to ignore promoted rules when formatting.

I tested the command dune build @fmt --ignore-promoted-rules manually (after removing the gospel library) in the ortac repository and it succeeded.

benmandrew commented 8 months ago

@edwintorok could you run dune fmt? I will then merge.