Skip to content

Releases: ocaml-mlx/ocamlformat-mlx

0.28.1.2

26 Jan 16:37

Choose a tag to compare

CHANGES:

0.28.1.1

02 Jan 11:03

Choose a tag to compare

CHANGES:

Highlight

  • * Update Odoc's parser to 3.0 (ocaml-ppx#2757, @Julow)
    The indentation of code-blocks containing OCaml code is reduced by 2 to avoid
    changing the generated documentation. The indentation within code-blocks is
    now significative in Odoc and shows up in generated documentation.

Added

  • Added option letop-punning (ocaml-ppx#2746, @WardBrian) to control whether
    punning is used in extended binding operators.
    For example, the code let+ x = x in ... can be formatted as
    let+ x in ... when letop-punning=always. With letop-punning=never, it
    becomes let+ x = x in .... The default is preserve, which will
    only use punning when it exists in the source.
    This also applies to let%ext bindings (ocaml-ppx#2747, @WardBrian).

  • Support the unnamed functor parameters syntax in module types
    (ocaml-ppx#2755, ocaml-ppx#2759, @Julow)

    module type F = ARG -> S

    The following lines are now formatted as they are in the source file:

    module M : (_ : S) -> (_ : S) -> S = N
    module M : S -> S -> S = N
    (* The preceding two lines are no longer turned into this: *)
    module M : (_ : S) (_ : S) -> S = N

Fixed

  • Fix dropped comment in (function _ -> x (* cmt *)) (ocaml-ppx#2739, @Julow)

  • * cases-matching-exp-indent=compact does not impact begin end nodes that
    don't have a match inside. (ocaml-ppx#2742, @EmileTrotignon)

    (* before *)
    begin match () with
    | () -> begin
      f x
    end
    end
    (* after *)
    begin match () with
    | () -> begin
        f x
      end
    end
  • Ast_mapper now iterates on all locations inside of Longident.t,
    instead of only some.
    (ocaml-ppx#2737, @v-gb)

Internal

  • Added information on writing tests to CONTRIBUTING.md (#2838, @WardBrian)

Changed

  • indentation of the end keyword in a match-case is now always at least 2. (ocaml-ppx#2742, @EmileTrotignon)

    (* before *)
    begin match () with
    | () -> begin
      match () with
      | () -> ()
    end
    end
    (* after *)
    begin match () with
    | () -> begin
      match () with
      | () -> ()
    
  • * use shortcut begin end in match cases and if then else body. (ocaml-ppx#2744, @EmileTrotignon)

    (* before *)
    match () with
    | () -> begin
        match () with
        | () ->
      end
    end
    (* after *)
    match () with
    | () ->
      begin match () with
        | () ->
      end
    end
  • * Set the ocaml-version to 5.4 by default (ocaml-ppx#2750, @EmileTrotignon)
    The main difference is that the effect keyword is recognized without having
    to add ocaml-version=5.3 to the configuration.
    In exchange, code that use effect as an identifier must use
    ocaml-version=5.2.

0.27.0.1

21 Jun 10:07

Choose a tag to compare

CHANGES:

  • relax OCaml constraints, compatible with OCaml 5.3

0.27.0

06 May 12:22
01b7b3b

Choose a tag to compare

CHANGES:

Highlight

Added

Changed

  • * Consistent formatting of comments (ocaml-ppx#2371, ocaml-ppx#2550, @Julow)
    This is mostly an internal change but some comments might be formatted differently.

  • * Improve formatting of type constraints with type variables (ocaml-ppx#2437, @gpetiot)
    For example:

    let f : type a b c.
        a -> b -> c =
      ...
    
  • * Improve formatting of functor arguments (ocaml-ppx#2505, @Julow)
    This also reduce the indentation of functor arguments with long signatures.

  • Improvements to the Janestreet profile (ocaml-ppx#2445, ocaml-ppx#2314, ocaml-ppx#2460, ocaml-ppx#2593, ocaml-ppx#2612, @Julow, @tdelvecchio-jsc)

  • * Undo let-bindings and methods normalizations (ocaml-ppx#2523, ocaml-ppx#2529, @gpetiot)
    This remove the rewriting of some forms of let-bindings and methods:

    • let f x = (x : int) is no longer rewritten into let f x : int = x
    • let f (type a) (type b) ... is no longer rewritten into let f (type a b) ...
    • let f = fun x -> ... is no longer rewritten into let f x = ...
  • * The break-colon option is now taken into account for method type constraints (ocaml-ppx#2529, @gpetiot)

  • * Force a break around comments following an infix operator (fix non-stabilizing comments) (ocaml-ppx#2478, @gpetiot)
    This adds a line break:

      a
      ||
      (* this comment is now on its own line *)
      b
    

Fixed

0.6

06 May 11:17
eb0bc4d

Choose a tag to compare

0.6

Fix prop wrapping #2 by @davesnx

<div
  className="some"
  className="another"
  className="third">
  <div
    className="some"
    className="another"
    className="third"
  />
</div>

0.2

24 Oct 17:08

Choose a tag to compare

0.2

Add jsx prop punning

0.1

23 Oct 19:09

Choose a tag to compare

0.1

Preview release