Skip to content

Commit a368005

Browse files
committed
Maintenance: reformat
Remove version constraint on .ocamlformat Signed-off-by: Christian Lindig <[email protected]>
1 parent e6d6ecd commit a368005

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

.ocamlformat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile=ocamlformat
2-
version=0.14.1
32
indicate-multiline-delimiters=closing-on-separate-line
43
if-then-else=fit-or-vertical
54
dock-collection-brackets=true

lib/debug.ml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,11 @@ module ThreadLocalTable = struct
4747
IntMap.find_opt id t.tbl
4848
end
4949

50+
type task = {desc: string; client: string option}
5051

51-
type task = {
52-
desc: string
53-
; client: string option
54-
}
52+
let tasks : task ThreadLocalTable.t = ThreadLocalTable.make ()
5553

56-
let tasks: task ThreadLocalTable.t = ThreadLocalTable.make ()
57-
58-
let names: string ThreadLocalTable.t = ThreadLocalTable.make ()
54+
let names : string ThreadLocalTable.t = ThreadLocalTable.make ()
5955

6056
let gettimestring () =
6157
let time = Unix.gettimeofday () in
@@ -75,11 +71,16 @@ let format include_time brand priority message =
7571
let id = get_thread_id () in
7672
let task, name =
7773
(* if the task's client is known, attach it to the task's name *)
78-
let name = match ThreadLocalTable.find names with Some x -> x | None -> "" in
74+
let name =
75+
match ThreadLocalTable.find names with Some x -> x | None -> ""
76+
in
7977
match ThreadLocalTable.find tasks with
80-
| None -> "", name
81-
| Some {desc; client=None} -> desc, name
82-
| Some {desc; client=Some client} -> desc, Printf.sprintf "%s->%s" client name
78+
| None ->
79+
("", name)
80+
| Some {desc; client= None} ->
81+
(desc, name)
82+
| Some {desc; client= Some client} ->
83+
(desc, Printf.sprintf "%s->%s" client name)
8384
in
8485
Printf.sprintf "[%s%5s||%d %s|%s|%s] %s"
8586
(if include_time then gettimestring () else "")
@@ -217,16 +218,17 @@ let log_backtrace_exn ?(level = Syslog.Err) ?(msg = "error") exn bt =
217218
List.iter (output_log "backtrace" level msg) all
218219

219220
let log_backtrace_internal ?level ?msg e _bt =
220-
Backtrace.is_important e;
221-
log_backtrace_exn ?level ?msg e (Backtrace.remove e)
221+
Backtrace.is_important e ;
222+
log_backtrace_exn ?level ?msg e (Backtrace.remove e)
222223

223224
let log_backtrace e bt = log_backtrace_internal e bt
224225

225226
let with_thread_associated ?client desc f x =
226227
ThreadLocalTable.add tasks {desc; client} ;
227-
let result = Backtrace.with_backtraces (fun () ->
228-
try f x
229-
with e -> Backtrace.is_important e; raise e) in
228+
let result =
229+
Backtrace.with_backtraces (fun () ->
230+
try f x with e -> Backtrace.is_important e ; raise e)
231+
in
230232
ThreadLocalTable.remove tasks ;
231233
match result with
232234
| `Ok result ->

lib_test/idl_test_common.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ module GenTestData (C : CONFIG) (M : MARSHALLER) = struct
178178
| _ ->
179179
Rpc.Dict named :: List.rev unnamed
180180
in
181-
let rpccall = if response_needed then Rpc.notification else Rpc.call in
181+
let rpccall =
182+
if response_needed then Rpc.notification else Rpc.call
183+
in
182184
rpccall wire_name args)
183185
params
184186
in

0 commit comments

Comments
 (0)