Skip to content

Commit 0b0dd83

Browse files
committed
reformat all the things
1 parent 042d5b4 commit 0b0dd83

Some content is hidden

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

91 files changed

+499
-174
lines changed

.ocamlformat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if-then-else=k-r
55
parens-ite=true
66
parens-tuple=multi-line-only
77
sequence-style=terminator
8-
type-decl=compact
8+
type-decl=sparse
99
break-cases=toplevel
1010
cases-exp-indent=2
1111
field-space=tight-decl

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ doc:
1717
examples:
1818
dune build examples/id_sexp.exe
1919

20+
format:
21+
@dune build $(DUNE_OPTS) @fmt --auto-promote
22+
23+
format-check:
24+
@dune build $(DUNE_OPTS) @fmt --display=quiet
25+
26+
2027
VERSION=$(shell awk '/^version:/ {print $$2}' containers.opam)
2128

2229
update_next_tag:

benchs/dune

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
(executables
22
(names run_benchs run_bench_hash run_objsize)
3-
(libraries containers containers_pvec
4-
containers-data benchmark gen iter
5-
qcheck oseq batteries base sek)
3+
(libraries
4+
containers
5+
containers_pvec
6+
containers-data
7+
benchmark
8+
gen
9+
iter
10+
qcheck
11+
oseq
12+
batteries
13+
base
14+
sek)
615
(flags :standard -warn-error -3-5 -safe-string -color always)
716
(optional)
8-
(ocamlopt_flags :standard -O3 -color always -unbox-closures
9-
-unbox-closures-factor 20))
17+
(ocamlopt_flags
18+
:standard
19+
-O3
20+
-color
21+
always
22+
-unbox-closures
23+
-unbox-closures-factor
24+
20))

benchs/run_bench_hash.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(** Test hash functions *)
22

3-
type tree = Empty | Node of int * tree list
3+
type tree =
4+
| Empty
5+
| Node of int * tree list
46

57
let mk_node i l = Node (i, l)
68

benchs/run_benchs.ml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,9 @@ module Tbl = struct
794794
val compare : t -> t -> int
795795
end
796796

797-
type _ key_type = Int : int key_type | Str : string key_type
797+
type _ key_type =
798+
| Int : int key_type
799+
| Str : string key_type
798800

799801
let arg_make : type a. a key_type -> (module KEY with type t = a) * string =
800802
function
@@ -918,7 +920,10 @@ module Tbl = struct
918920

919921
module M = CCHashTrie.Make (K)
920922

921-
type 'a t = { id: CCHashTrie.Transient.t; mutable map: 'a M.t }
923+
type 'a t = {
924+
id: CCHashTrie.Transient.t;
925+
mutable map: 'a M.t;
926+
}
922927

923928
let create _ = { id = CCHashTrie.Transient.create (); map = M.empty }
924929
let find m k = M.get_exn k m.map
@@ -1237,7 +1242,11 @@ module Deque = struct
12371242
end
12381243

12391244
module Base : DEQUE = struct
1240-
type 'a elt = { content: 'a; mutable prev: 'a elt; mutable next: 'a elt }
1245+
type 'a elt = {
1246+
content: 'a;
1247+
mutable prev: 'a elt;
1248+
mutable next: 'a elt;
1249+
}
12411250
(** A cell holding a single element *)
12421251

12431252
and 'a t = 'a elt option ref

examples/ccparse_irclogs_real.cond.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ let pp_datetime out d =
1414
CCFormat.(
1515
fprintf out "{y=%d;M=%d;d=%d;h=%d;m=%d;s=%d}" year month day hour min sec)
1616

17-
type msg = { timestamp: datetime; user: string; msg: string }
17+
type msg = {
18+
timestamp: datetime;
19+
user: string;
20+
msg: string;
21+
}
1822

1923
let pp_msg out m =
2024
CCFormat.fprintf out "{@[time=%a;@ user=%S;@ msg=%S@]}" pp_datetime

examples/ccparse_sexp.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
open CCParse
22

3-
type sexp = Atom of string | List of sexp list
3+
type sexp =
4+
| Atom of string
5+
| List of sexp list
46

57
let rec pp_sexpr out (s : sexp) : unit =
68
match s with

fuzz/dune

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
(executables
22
(flags
33
(-w "+a-4-9-29-37-40-42-44-48-50-32" -g))
4-
(names ccsexp_parse_string_does_not_crash
5-
ccutf8_string_uchar_to_bytes_is_same_as_simple_version
6-
ccsexp_csexp_reparse)
4+
(names
5+
ccsexp_parse_string_does_not_crash
6+
ccutf8_string_uchar_to_bytes_is_same_as_simple_version
7+
ccsexp_csexp_reparse)
78
(optional)
89
(libraries crowbar containers))

src/bencode/containers_bencode.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module Str_map = Map.Make (String)
22

3-
type t = Int of int64 | String of string | List of t list | Map of t Str_map.t
3+
type t =
4+
| Int of int64
5+
| String of string
6+
| List of t list
7+
| Map of t Str_map.t
48

59
let rec equal t1 t2 =
610
match t1, t2 with

src/bencode/containers_bencode.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66

77
module Str_map : module type of Map.Make (String)
88

9-
type t = Int of int64 | String of string | List of t list | Map of t Str_map.t
9+
type t =
10+
| Int of int64
11+
| String of string
12+
| List of t list
13+
| Map of t Str_map.t
1014

1115
val equal : t -> t -> bool
1216
val hash : t -> int

0 commit comments

Comments
 (0)