Skip to content

Add ocamlformat formatter #205

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

Merged
merged 6 commits into from
Nov 18, 2022
Merged

Add ocamlformat formatter #205

merged 6 commits into from
Nov 18, 2022

Conversation

dimitrijer
Copy link
Contributor

Fixes #204.

We have to handle a case when buffer without filename is formatted, as
ocamlformat expects `--name`, `--impl`, or `--intf` to be provided. In
case `--name` is provided, ocamlformat will use path of that file as
starting point for searching for .ocamlformat. When formatting buffers
with no filename, we provide `--impl` explicitly, to indicate that
ocamlformat should parse the input as an implementation rather than an
interface.
Copy link
Contributor

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about error handling. Looks good otherwise.

@dimitrijer dimitrijer requested a review from dbarnett November 15, 2022 06:36
@dbarnett dbarnett merged commit cf9683d into google:master Nov 18, 2022
@dbarnett
Copy link
Contributor

Thanks!

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.

Formatter for OCaml
2 participants