Skip to content

Commit d2fa859

Browse files
authored
Merge pull request #997 from Julow/preview-ocamlformat-0.26.1
Upgrade OCamlformat to 0.26.1
2 parents 6fcb096 + 6957ee7 commit d2fa859

File tree

6 files changed

+65
-73
lines changed

6 files changed

+65
-73
lines changed

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ c5b7900eb40a48e2877db4994a2b2f8d755531e4
66
8b4a11d74af7dd4de0ae9463af3c9d563d758cfc
77
# ocamlformat 0.25.1
88
0f01f32f3b3adc849bc7cc859776763a9139da19
9+
# Upgrade to OCamlformat 0.26.0
10+
1cf80035f66badcc8b4e667cbfd13cb483a7a773
11+
# Upgrade to OCamlformat 0.26.1
12+
1c015488b8d32a0571eaa144a92ab4725bad0b85

.ocamlformat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
module-item-spacing=preserve
2-
version=0.25.1
2+
version=0.26.1
3+
ocaml-version=4.02

doc/examples/markup.mli

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,46 +52,42 @@ module type Foo = sig
5252
val bar : string
5353
(** This comment is associated to bar. *)
5454

55-
class cl :
56-
object
57-
58-
(** Interesting information about cl *)
59-
end
55+
class cl : object
56+
(** Interesting information about cl *)
57+
end
6058

6159
(** The comment for class my_class *)
62-
class my_class :
63-
object
64-
inherit cl
65-
(** A comment to describe inheritance from cl *)
60+
class my_class : object
61+
inherit cl
62+
(** A comment to describe inheritance from cl *)
6663

67-
val mutable tutu : string
68-
(** The comment for attribute tutu *)
64+
val mutable tutu : string
65+
(** The comment for attribute tutu *)
6966

70-
val toto : int
71-
(** The comment for attribute toto. *)
67+
val toto : int
68+
(** The comment for attribute toto. *)
7269

73-
(** This comment is not attached to titi since
70+
(** This comment is not attached to titi since
7471
there is a blank line before titi, but is kept
7572
as a comment in the class. *)
7673

77-
val titi : string
74+
val titi : string
7875

79-
method toto : string
80-
(** Comment for method toto *)
76+
method toto : string
77+
(** Comment for method toto *)
8178

82-
method m : float -> int
83-
(** Comment for method m *)
84-
end
79+
method m : float -> int
80+
(** Comment for method m *)
81+
end
8582

8683
(** The comment for the class type my_class_type *)
87-
class type my_class_type =
88-
object
89-
val mutable x : int
90-
(** The comment for variable x. *)
84+
class type my_class_type = object
85+
val mutable x : int
86+
(** The comment for variable x. *)
9187

92-
method m : int -> int
93-
(** The comment for method m. *)
94-
end
88+
method m : int -> int
89+
(** The comment for method m. *)
90+
end
9591

9692
(** The comment for module Foo *)
9793
module Foo : sig
@@ -119,16 +115,15 @@ end
119115
module Stop : sig
120116
(** This module demonstrates the use of stop comments ([(**/**)]) *)
121117

122-
class type foo =
123-
object
124-
method m : string
125-
(** comment for method m *)
118+
class type foo = object
119+
method m : string
120+
(** comment for method m *)
126121

127-
(**/**)
122+
(**/**)
128123

129-
method bar : int
130-
(** This method won't appear in the documentation *)
131-
end
124+
method bar : int
125+
(** This method won't appear in the documentation *)
126+
end
132127

133128
val foo : string
134129
(** This value appears in the documentation, since the Stop special comment

src/ocamlary/ocamlary.mli

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -579,23 +579,19 @@ type my_mod = (module COLLECTION)
579579

580580
class empty_class : object end
581581

582-
class one_method_class :
583-
object
584-
method go : unit
585-
end
582+
class one_method_class : object
583+
method go : unit
584+
end
586585

587-
class two_method_class :
588-
object
589-
method one : one_method_class
586+
class two_method_class : object
587+
method one : one_method_class
590588

591-
method undo : unit
592-
end
589+
method undo : unit
590+
end
593591

594-
class ['a] param_class :
595-
'a
596-
-> object
597-
method v : 'a
598-
end
592+
class ['a] param_class : 'a -> object
593+
method v : 'a
594+
end
599595

600596
type my_unit_object = unit param_class
601597

@@ -609,10 +605,9 @@ type 'a my_unit_class = unit #param_class as 'a
609605
(* Test resolution of dependently typed modules *)
610606
module Dep1 : sig
611607
module type S = sig
612-
class c :
613-
object
614-
method m : int
615-
end
608+
class c : object
609+
method m : int
610+
end
616611
end
617612

618613
module X : sig
@@ -726,10 +721,9 @@ module type Dep10 = Dep9(Dep8).T with type t = int
726721

727722
module Dep11 : sig
728723
module type S = sig
729-
class c :
730-
object
731-
method m : int
732-
end
724+
class c : object
725+
method m : int
726+
end
733727
end
734728
end
735729

src/xref2/env.ml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -523,15 +523,14 @@ let s_module : Component.Element.module_ scope =
523523

524524
let s_any : Component.Element.any scope =
525525
make_scope ~root:lookup_page_or_root_module_fallback
526-
~check:
527-
(fun env -> function
528-
| `Label (id, _) -> (
529-
try
530-
Some
531-
(Identifier.Maps.Label.find id env.ambiguous_labels
532-
:> Component.Element.any amb_err)
533-
with Not_found -> None)
534-
| _ -> None)
526+
~check:(fun env -> function
527+
| `Label (id, _) -> (
528+
try
529+
Some
530+
(Identifier.Maps.Label.find id env.ambiguous_labels
531+
:> Component.Element.any amb_err)
532+
with Not_found -> None)
533+
| _ -> None)
535534
(function
536535
(* Reference to [A] could refer to [extension-A] or [extension-decl-A].
537536
The legacy behavior refers to the constructor [extension-A]. *)
@@ -562,11 +561,10 @@ let s_value : Component.Element.value scope =
562561

563562
let s_label : Component.Element.label scope =
564563
make_scope
565-
~check:
566-
(fun env -> function
567-
| `Label (id, _) -> (
568-
try Some (Identifier.Maps.Label.find id env.ambiguous_labels)
569-
with Not_found -> None))
564+
~check:(fun env -> function
565+
| `Label (id, _) -> (
566+
try Some (Identifier.Maps.Label.find id env.ambiguous_labels)
567+
with Not_found -> None))
570568
(function #Component.Element.label as r -> Some r | _ -> None)
571569

572570
let s_constructor : Component.Element.constructor scope =

src/xref2/ref_tools.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ module L = struct
349349
| `Heading
350350
( _,
351351
({ Odoc_model.Paths.Identifier.iv = `Label (_, name'); _ } as
352-
label),
352+
label),
353353
_ )
354354
when name = LabelName.to_string name' ->
355355
Ok (`Identifier label)

0 commit comments

Comments
 (0)