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

use a custom command to format dune files #10863

Open
Khady opened this issue Aug 30, 2024 · 3 comments
Open

use a custom command to format dune files #10863

Khady opened this issue Aug 30, 2024 · 3 comments
Labels
help wanted proposal RFC's that are awaiting discussion to be accepted or rejected

Comments

@Khady
Copy link
Contributor

Khady commented Aug 30, 2024

Desired Behavior

We would like to be able to format dune files using a different tool than dune but still have dune run that tool during dune build @fmt and when requested from ocamllsp.

Example

in dune-project

(formatting
  (dune (command custom_dune_formatter %{dep})))

would lead dune to run custom_dune_formatter path/to/dune when dune tries to format path/to/dune.

@Khady
Copy link
Contributor Author

Khady commented Aug 30, 2024

would it be possible to do that using the dialect stanza? Can we use the dialect stanza to change dune's behavior for some dialects already known to dune? And is the dune language a dialect?

Thanks for the suggestion @davesnx

@nojb
Copy link
Collaborator

nojb commented Aug 30, 2024

We would like to be able to format dune files using a different tool than dune

I have a vague recollection that this point came up in the past in the context of OCaml source code (eg to use ocp-indent instead of ocamlformat) and the proposal was rejected, but I don't remember the details...

And is the dune language a dialect?

No, dialects are only alternative forms of OCaml.

@rgrinberg rgrinberg added the proposal RFC's that are awaiting discussion to be accepted or rejected label Sep 3, 2024
@rgrinberg
Copy link
Member

No objections to this feature request, but if you want this one done, you will need to work on it yourself. This is too niche for us to work on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted proposal RFC's that are awaiting discussion to be accepted or rejected
Projects
None yet
Development

No branches or pull requests

3 participants