Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

shonfeder
Copy link
Contributor

Closes #936

This is a workaround for ocaml/dune#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.

This is a workaround for ocaml/dune#10578

Once `dune build @fmt` allows clean exits even when ocamlformat is not
installed, we should remove this case, so that we still have the benefit
of running other formatting lints that may be associated with the @fmt
alias.
@shonfeder shonfeder merged commit 62fa209 into ocurrent:master May 27, 2024
2 checks passed
@shonfeder shonfeder deleted the 936/noop-fmt-lint-when-no-ocamlformat branch May 27, 2024 17:15
shonfeder added a commit to shonfeder/ocaml-ci that referenced this pull request May 31, 2024
Reworking fixing an error I introduced in
ocurrent#937
shonfeder added a commit that referenced this pull request May 31, 2024
Reworking fixing an error I introduced in
#937
mtelvers pushed a commit to mtelvers/ocaml-ci that referenced this pull request Aug 2, 2024
Reworking fixing an error I introduced in
ocurrent#937
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lint-fmt job fails with "Error: Program ocamlformat not found in the tree or in PATH"
2 participants