ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Auto-formatter for OCaml code

Results 143 ocamlformat issues
Sort by recently updated
recently updated
newest added

**Current behavior** Currently, `not a && not b` gets styled to `(not a) && not b`. There are similar issues with other forms without terminating delimiters, like `match`, where they...

Kind/style-suggestion
JaneStreet

Currently the following code: ```ocaml let f x = match x.v with | Foo asdasdassdasdasdadasasddaasdas -> foosadadadasdsa asdadadadsa dadasdsadasdasdas | Bar -> sdasdas ``` is formatted into: ```ocaml let f...

Kind/style-suggestion

**Is your feature request related to a problem? Please describe.** Currently, single-field records and single-case variants are squeezed onto one line, whenever possible. ```ocaml type t = Foo of int...

Kind/style-suggestion

**Is your feature request related to a problem? Please describe.** Given the following module definition: ```ocaml module Foo (X : S) = struct let v = 1 end ``` Annotating...

Kind/feature-request

Without this docstrings with UTF8 withing `[]` have miscalculated lengths. This adds (some of?) the normalization needed for `[...]` docstring elements. Currently this change also incorrectly applies to preformatted code...

The option `break-infix=fit-or-vertical` allows to break before every infix operators if the whole expression does not fit on a single line: ```diff - get_succs parent |> Sequence.of_list + get_succs parent...

Kind/Feature-request

Hi, I've been experimenting with removing mutable state from the formatting parts of ocamlformat. Here's a brain dump of my understanding before I forget. At the moment, formatting uses mutable...

**Is your feature request related to a problem? Please describe.** On `ocamlformat.0.19.0`, with the conventional profile, the formatting of AST nodes of the form `[%ext ...]; ...` is oddly context-sensitive....

Kind/feature-request

The following example is OCamlformatted: ```ocaml ;; assert ( (* [a] is true *) let a = true in a ) ``` This placement of the comment before the `let`...

Kind/feature-request

The option `field-space=tight-decl` should also apply to signature items, which are very similar to record fields, eg: ``` val foo: ty ``` instead of ``` val foo : ty ```...

Kind/feature-request