Skip to content

Commit 78fb608

Browse files
committed
Update ocamlformat to 0.27.0
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 14c5f9e commit 78fb608

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+367
-233
lines changed

.ocamlformat

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
version=0.26.2
2-
break-cases = fit
3-
break-collection-expressions = fit-or-vertical
4-
break-fun-decl = wrap
5-
break-fun-sig = wrap
6-
break-infix = wrap
7-
break-infix-before-func = false
8-
break-sequences = false
9-
break-separators = before
10-
break-string-literals = never
11-
break-struct = force
12-
cases-matching-exp-indent = compact
13-
doc-comments = after-when-possible
14-
dock-collection-brackets = false
15-
indicate-multiline-delimiters = no
16-
infix-precedence = indent
17-
let-and = compact
18-
let-binding-spacing = compact
19-
module-item-spacing = compact
20-
parens-tuple = multi-line-only
21-
parens-tuple-patterns = multi-line-only
22-
sequence-style = terminator
23-
sequence-blank-line = compact
24-
single-case = compact
25-
type-decl = compact
26-
if-then-else = keyword-first
27-
field-space = loose
28-
space-around-arrays = false
29-
space-around-records = false
30-
space-around-lists = false
31-
space-around-variants = false
32-
ocp-indent-compat = true
1+
version=0.27.0
2+
break-cases=fit
3+
break-collection-expressions=fit-or-vertical
4+
break-fun-decl=wrap
5+
break-fun-sig=wrap
6+
break-infix-before-func=false
7+
break-infix=wrap
8+
break-separators=before
9+
break-sequences=false
10+
break-string-literals=never
11+
break-struct=force
12+
cases-matching-exp-indent=compact
13+
doc-comments=after-when-possible
14+
dock-collection-brackets=false
15+
field-space=loose
16+
if-then-else=keyword-first
17+
indicate-multiline-delimiters=no
18+
infix-precedence=indent
19+
let-and=compact
20+
let-binding-spacing=compact
21+
module-item-spacing=compact
22+
ocp-indent-compat=true
23+
parens-tuple-patterns=multi-line-only
24+
parens-tuple=multi-line-only
25+
parse-docstrings=false
26+
sequence-blank-line=compact
27+
sequence-style=terminator
28+
single-case=compact
29+
space-around-arrays=false
30+
space-around-lists=false
31+
space-around-records=false
32+
space-around-variants=false
33+
type-decl=compact

src/baselib/dynlink_wrapper.natdynlink.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
open Dynlink
2222

src/baselib/dynlink_wrapper.nonatdynlink.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
exception Error of string
2222

src/baselib/ocsigen_cache.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818
(**
1919
Cache.
2020
@@ -124,9 +124,9 @@ end = struct
124124
; mutable maxsize : int
125125
; mutable finaliser_before : 'a node -> unit
126126
; mutable finaliser_after : 'a node -> unit
127-
; (* *) time_bound : time_bound option }
127+
; time_bound : time_bound option }
128128

129-
and time_bound = {(* *) timer : float; mutable collector : unit Lwt.t option}
129+
and time_bound = {timer : float; mutable collector : unit Lwt.t option}
130130

131131
(* Checks (by BY):
132132
@@ -435,7 +435,7 @@ functor
435435
; mutable table : (A.value * A.key Dlist.node) H.t
436436
; finder : A.key -> A.value Lwt.t
437437
; clear : unit -> unit
438-
(* This function clears the cache. It is put inside the
438+
(* This function clears the cache. It is put inside the
439439
cache structure so that it is garbage-collected only when the cache
440440
is no longer referenced, as the functions themselves are put inside
441441
a weak hash table *)

src/baselib/ocsigen_cache.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
(**
2020
Cache.

src/baselib/ocsigen_lib.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
include Ocsigen_lib_base
2020
module String = String_base
@@ -69,8 +69,9 @@ module Filename = struct
6969
then String.sub filename (pos + 1) (String.length filename - pos - 1)
7070
else (* Dot before a directory separator *)
7171
raise Not_found
72-
with Not_found -> (* No dot in filename *)
73-
raise Not_found
72+
with Not_found ->
73+
(* No dot in filename *)
74+
raise Not_found
7475
end
7576

7677
(*****************************************************************************)
@@ -399,7 +400,6 @@ module Url = struct
399400
https, host, port, path, query
400401
in
401402
(* Note that the fragment (string after #) is not sent by browsers *)
402-
403403
(*20110707 ' ' is encoded to '+' in queries, but not in paths.
404404
Warning: if we write the URL manually, we must encode ' ' to '+' manually
405405
(not done by the browser).

src/baselib/ocsigen_lib.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
(** This module contains some auxiliaries for the Ocsigenserver. In contrast to
2020
{!Ocsigen_lib_base}, the function may also refer to libraries other than the

src/baselib/ocsigen_lib_base.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
exception Ocsigen_Internal_Error of string
2020
exception Input_is_too_large

src/baselib/ocsigen_lib_base.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
(** This module just contains only extensions of the standard library and very
2020
basic Ocsigen values and exceptions. Cf. {!Ocsigen_lib} for functionality

src/baselib/ocsigen_loader.ml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
open Ocsigen_lib
2222

@@ -33,18 +33,19 @@ let translate =
3333
if Ocsigen_config_static.is_native
3434
then
3535
fun filename ->
36-
if Filename.check_suffix filename ".cmo"
37-
|| Filename.check_suffix filename ".cma"
38-
then Filename.chop_extension filename ^ ".cmxs"
39-
else filename
36+
if
37+
Filename.check_suffix filename ".cmo"
38+
|| Filename.check_suffix filename ".cma"
39+
then Filename.chop_extension filename ^ ".cmxs"
40+
else filename
4041
else
4142
fun filename ->
42-
if Filename.check_suffix filename ".cmxs"
43-
then
44-
let filename = Filename.chop_extension filename in
45-
let cma = filename ^ ".cma" in
46-
if Sys.file_exists cma then cma else filename ^ ".cmo"
47-
else filename
43+
if Filename.check_suffix filename ".cmxs"
44+
then
45+
let filename = Filename.chop_extension filename in
46+
let cma = filename ^ ".cma" in
47+
if Sys.file_exists cma then cma else filename ^ ".cmo"
48+
else filename
4849

4950
(************************************************************************)
5051
(* Loading files *)

src/baselib/ocsigen_loader.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(** Module [Ocsigen_loader]: Dynamic loading for Ocsigen. *)
2222

src/baselib/ocsigen_stream.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
open Ocsigen_lib
2020

@@ -154,7 +154,7 @@ let rec stream_want s len =
154154
Lwt.catch
155155
(fun () -> enlarge_stream s >>= fun r -> Lwt.return (`OK r))
156156
(function
157-
| Stream_too_small -> Lwt.return `Too_small | e -> Lwt.fail e)
157+
| Stream_too_small -> Lwt.return `Too_small | e -> Lwt.fail e)
158158
>>= function
159159
| `OK r -> stream_want r len
160160
| `Too_small -> Lwt.return s)

src/baselib/ocsigen_stream.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818

1919
exception Interrupted of exn
2020
exception Cancelled

src/baselib/polytables/polytables.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818
(**
1919
@author Vincent Balat
2020
@author Jérôme Vouillon

src/baselib/polytables/polytables.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* You should have received a copy of the GNU Lesser General Public License
1515
* along with this program; if not, write to the Free Software
1616
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17-
*)
17+
*)
1818
(**
1919
Polymorphic tables (using Map)
2020
@author Vincent Balat

src/extensions/accesscontrol.ml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(* Filtering requests via the configuration file *)
2222

@@ -368,10 +368,11 @@ let parse_config parse_fun = function
368368
| Ocsigen_extensions.Req_found (_, r) ->
369369
Lwt.return (Ocsigen_extensions.Ext_found (fun () -> Lwt.return r))
370370
| Ocsigen_extensions.Req_not_found (err, _ri) ->
371-
if let err =
372-
string_of_int Cohttp.Code.(code_of_status (err :> status_code))
373-
in
374-
Netstring_pcre.string_match re err 0 <> None
371+
if
372+
let err =
373+
string_of_int Cohttp.Code.(code_of_status (err :> status_code))
374+
in
375+
Netstring_pcre.string_match re err 0 <> None
375376
then Lwt.return (Ocsigen_extensions.Ext_sub_result ext)
376377
else Lwt.return (Ocsigen_extensions.Ext_next err))
377378
| Element (("ifnotfound" as s), _, _) ->
@@ -433,10 +434,11 @@ let ifnotfound ?code instrs vh ci p =
433434
(Ocsigen_extensions.Ext_sub_result
434435
(Ocsigen_extensions.compose (List.map (fun i -> i vh ci p) instrs)))
435436
| Some re ->
436-
if let err =
437-
string_of_int Cohttp.Code.(code_of_status (err :> status_code))
438-
in
439-
Netstring_pcre.string_match re err 0 <> None
437+
if
438+
let err =
439+
string_of_int Cohttp.Code.(code_of_status (err :> status_code))
440+
in
441+
Netstring_pcre.string_match re err 0 <> None
440442
then
441443
Lwt.return
442444
(Ocsigen_extensions.Ext_sub_result

src/extensions/accesscontrol.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(** Accesscontrol: Conditional access to some sites *)
2222

src/extensions/authbasic.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
open Lwt.Infix
2222

src/extensions/authbasic.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(** Authbasic: Basic HTTP authentication *)
2222

src/extensions/cors.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(** Handle Cross-Origin Resource Sharing (CORS) headers *)
2222

src/extensions/deflatemod.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(* Compress output sent by the server *)
2222

src/extensions/extendconfiguration.ml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
let name = "extendconfiguration"
2222
let bad_config s = raise (Ocsigen_extensions.Error_in_config_file s)
@@ -275,8 +275,15 @@ let defaultindex v _ _ _ =
275275
gen @@ fun config ->
276276
{config with Ocsigen_extensions.default_directory_index = v}
277277

278-
let contenttype ?default ?(files = []) ?(extensions = []) ?(regexps = []) () _ _
279-
_
278+
let contenttype
279+
?default
280+
?(files = [])
281+
?(extensions = [])
282+
?(regexps = [])
283+
()
284+
_
285+
_
286+
_
280287
=
281288
gen @@ fun config ->
282289
let mime_assoc = config.Ocsigen_extensions.mime_assoc in

src/extensions/outputfilter.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* You should have received a copy of the GNU Lesser General Public License
1717
* along with this program; if not, write to the Free Software
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19-
*)
19+
*)
2020

2121
(* This module enables rewritting the server output *)
2222

0 commit comments

Comments
 (0)