ocamlformat
ocamlformat copied to clipboard
Auto-formatter for OCaml code
The indentation feels off in the following example: ```ocaml let rec equal_list : 'a. ('a, 't) gexpr marked list -> ('a, 't) gexpr marked list -> bool = fun es1...
Hi all, I use the following `.ocamlformat`: ``` profile=default ocaml-version=4.14.0 ``` When I try to apply it on this code: ```ocaml let () = f (object method m x =...
OCaml 4.11.1, ocamlformat 0.24.1, code with objects and classes. I have the following `.ocamlformat` file: ```ini profile = janestreet version = 0.24.1 ``` Code formatted with ocamlformat contains no indents...
In the following example, some arguments are on the same line (` ~sponge:sponge_before_evaluations ~xi ~advice ~opening`) while some the others are listed as a single argument per line. I think...
Prompted by @rgrinberg
When using ocamlformat under emacs, a buffer pops up very often saying the following ``` ocamlformat errors: ocamlformat: SRC… arguments: no '117-117' file Usage: ocamlformat [OPTION]… [SRC]… Try 'ocamlformat --help'...
Extracted from ocamlformat-ng's concrete AST, replacing the convoluted pattern `Ppat_constraint(Ppat_unpack x, Ptyp_package y)` with `Ppat_unpack(x, Some y)` Preserving this syntax (and not removing/adding keywords) makes the formatting of comments easier.
Extracted from ocamlformat-ng's concrete AST PS: preserving this syntax (and not removing/adding keywords) makes the formatting of comments easier.
```bash $ ls -a . .. .ocamlformat .ocamlformat-ignore a.ml $ cat .ocamlformat $ cat .ocamlformat-ignore *.ml $ cat a.ml let _ = 1 $ ocamlformat a.ml let _ = 1...
**What is the reason for this new style?** * Consistency with other `fit-or-vertical` wrapping options * Makes function calls with many arguments easier to read, particularly for printf/format-style calls where...