Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ profile. This started with version 0.26.0.
end
```

- \* Set the `ocaml-version` to `5.4` by default (#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.28.1

### Highlight
Expand Down
3 changes: 1 addition & 2 deletions doc/manpage_ocamlformat.mld
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,7 @@ OPTIONS
omitted.

--ocaml-version=V
Version of OCaml syntax of the output. The default value is
4.04.0.
Version of OCaml syntax of the output. The default value is 5.4.0.

--ocp-indent-config
Read .ocp-indent configuration files. base is an alias for
Expand Down
2 changes: 1 addition & 1 deletion lib/Conf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ let default =
; disable= elt false
; margin_check= elt false
; max_iters= elt 10
; ocaml_version= elt Ocaml_version.Releases.v4_04_0
; ocaml_version= elt (Ocaml_version.v ~patch:0 5 4)
; quiet= elt false
; disable_conf_attrs= elt false
; version_check= elt true } }
Expand Down
6 changes: 3 additions & 3 deletions test/cli/print_config.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ No redundant values:
disable=false
margin-check=false
max-iters=10
ocaml-version=4.04.0
ocaml-version=5.4.0
quiet=false
disable-conf-attrs=false
version-check=true
Expand Down Expand Up @@ -99,7 +99,7 @@ Redundant values from the conventional profile:
disable=false
margin-check=false
max-iters=10
ocaml-version=4.04.0
ocaml-version=5.4.0
quiet=false
disable-conf-attrs=false
version-check=true
Expand Down Expand Up @@ -180,7 +180,7 @@ Redundant values from the ocamlformat profile:
disable=false
margin-check=false
max-iters=10
ocaml-version=4.04.0
ocaml-version=5.4.0
quiet=false
disable-conf-attrs=false
version-check=true
Expand Down
5 changes: 4 additions & 1 deletion test/passing/gen/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1732,19 +1732,22 @@

(rule
(deps .ocamlformat)
(enabled_if (>= %{ocaml_version} 5.3))
(package ocamlformat)
(action
(with-stdout-to effects.ml.stdout
(with-stderr-to effects.ml.stderr
(run %{bin:ocamlformat} --name effects.ml --margin-check --ocaml-version=5.3 %{dep:../tests/effects.ml})))))
(run %{bin:ocamlformat} --name effects.ml --margin-check %{dep:../tests/effects.ml})))))

(rule
(alias runtest)
(enabled_if (>= %{ocaml_version} 5.3))
(package ocamlformat)
(action (diff effects.ml.ref effects.ml.stdout)))

(rule
(alias runtest)
(enabled_if (>= %{ocaml_version} 5.3))
(package ocamlformat)
(action (diff effects.ml.err effects.ml.stderr)))

Expand Down
1 change: 0 additions & 1 deletion test/passing/refs.ahrefs/.ocamlformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
profile=default
ocaml-version=4.14.0

break-cases=toplevel
break-infix-before-func=false
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.default/extensions-indent.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end)
object%ext
method x = y
end

let _ =
f
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.default/extensions.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end)
object%ext
method x = y
end

let _ =
f
Expand Down
2 changes: 1 addition & 1 deletion test/passing/refs.default/labelled_args.ml.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let _ =
let f ~y = y + 1 in
f ~y:(y : int)
f ~(y : int)

let () =
very_long_function_name
Expand Down
10 changes: 4 additions & 6 deletions test/passing/refs.default/let_punning.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,23 @@ and y = 2
and z = 3

let p =
let* x = x and* y = y and* z = z in
let* x = x and* y and* z = z in
(x, y, z)

let q =
let%foo x = x and y = y and z = z in
let%foo x and y = y and z in
(x, y, z)

let r =
let* (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and* (* 5 *) y =
y
and* (* 5 *) y
(* 6 *)
in
(x, y)

let s =
let%foo (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and (* 5 *) y =
y
and (* 5 *) y
(* 6 *)
in
(x, y)
4 changes: 2 additions & 2 deletions test/passing/refs.default/object.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type t = (int, int) #q
let _ = object%js end
let _ = object%js (super) end
let _ = object%js (super : 'a) end
let _ = f (object end)
let _ = f (object%js end)
let _ = f object end
let _ = f object%js end

class t ~a =
object
Expand Down
18 changes: 9 additions & 9 deletions test/passing/refs.default/object_expr.ml.ref
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(object
method one = 1
end)
object
method one = 1
end
#one
;;

Some
(object
method one = 1
end)
object
method one = 1
end
;;

ignore
(object
method one = 1
end)
object
method one = 1
end
;;

let () =
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.janestreet/extensions-indent.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end)
object%ext
method x = y
end
;;

let _ =
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.janestreet/extensions.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end)
object%ext
method x = y
end
;;

let _ =
Expand Down
2 changes: 1 addition & 1 deletion test/passing/refs.janestreet/labelled_args.ml.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let _ =
let f ~y = y + 1 in
f ~y:(y : int)
f ~(y : int)
;;

let () =
Expand Down
12 changes: 5 additions & 7 deletions test/passing/refs.janestreet/let_punning.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,29 @@ and z = 3

let p =
let* x = x
and* y = y
and* y
and* z = z in
x, y, z
;;

let q =
let%foo x = x
let%foo x
and y = y
and z = z in
and z in
x, y, z
;;

let r =
let* (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and* (* 5 *) y =
y
and* (* 5 *) y
(* 6 *)
in
x, y
;;

let s =
let%foo (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and (* 5 *) y =
y
and (* 5 *) y
(* 6 *)
in
x, y
Expand Down
4 changes: 2 additions & 2 deletions test/passing/refs.janestreet/object.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ type t = (int, int) #q
let _ = object%js end
let _ = object%js (super) end
let _ = object%js (super : 'a) end
let _ = f (object end)
let _ = f (object%js end)
let _ = f object end
let _ = f object%js end

class t ~a =
object
Expand Down
18 changes: 9 additions & 9 deletions test/passing/refs.janestreet/object_expr.ml.ref
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(object
method one = 1
end)
object
method one = 1
end
#one
;;

Some
(object
method one = 1
end)
object
method one = 1
end
;;

ignore
(object
method one = 1
end)
object
method one = 1
end
;;

let () =
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.ocamlformat/extensions-indent.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end )
object%ext
method x = y
end

let _ =
f
Expand Down
6 changes: 3 additions & 3 deletions test/passing/refs.ocamlformat/extensions.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ let _ =

let _ =
f
(object%ext
method x = y
end )
object%ext
method x = y
end

let _ =
f
Expand Down
2 changes: 1 addition & 1 deletion test/passing/refs.ocamlformat/labelled_args.ml.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let _ =
let f ~y = y + 1 in
f ~y:(y : int)
f ~(y : int)

let () =
very_long_function_name
Expand Down
10 changes: 4 additions & 6 deletions test/passing/refs.ocamlformat/let_punning.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,23 @@ and y = 2
and z = 3

let p =
let* x = x and* y = y and* z = z in
let* x = x and* y and* z = z in
(x, y, z)

let q =
let%foo x = x and y = y and z = z in
let%foo x and y = y and z in
(x, y, z)

let r =
let* (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and* (* 5 *) y =
y
and* (* 5 *) y
(* 6 *)
in
(x, y)

let s =
let%foo (* 1 *) x (* 2 *) = (* 3 *) x (* 4 *)
and (* 5 *) y =
y
and (* 5 *) y
(* 6 *)
in
(x, y)
4 changes: 2 additions & 2 deletions test/passing/refs.ocamlformat/object.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ let _ = object%js (super) end

let _ = object%js (super : 'a) end

let _ = f (object end)
let _ = f object end

let _ = f (object%js end)
let _ = f object%js end

class t ~a =
object
Expand Down
Loading
Loading