Specify type signatures for some local functions

This commit is contained in:
Dmitrii Kovanikov 2023-04-02 13:37:54 +01:00
parent 742b0810ba
commit 23075d6397
No known key found for this signature in database
GPG Key ID: B366F56176659E62
3 changed files with 6 additions and 6 deletions

View File

@ -2,10 +2,10 @@ open Core
(* Custom types *)
let to_force_flag (flag : bool) =
let to_force_flag (flag : bool) : Git.force_flag =
if flag then Git.Force else Git.NoForce
let to_tag_action (is_delete : bool) =
let to_tag_action (is_delete : bool) : Git.tag_action =
if is_delete then Git.Delete else Git.Create
(* Commands *)

View File

@ -1,13 +1,13 @@
(* INTERNALS *)
let get_current_branch () =
let get_current_branch () : string =
Process.proc_stdout "git rev-parse --abbrev-ref HEAD"
let fetch_main_branch () =
let fetch_main_branch () : string =
let remote_main_branch = Process.proc_stdout "git rev-parse --abbrev-ref origin/HEAD" in
Process.proc_stdout (Printf.sprintf "basename %s" remote_main_branch) (* TODO: use pure function *)
let branch_or_main branch_opt =
let branch_or_main (branch_opt : string option) : string =
match branch_opt with
| Some branch -> branch
| None -> fetch_main_branch ()

View File

@ -3,7 +3,7 @@ let proc cmd =
let _exit_code = Unix.system cmd in
()
let collect_chan (channel : in_channel) =
let collect_chan (channel : in_channel) : string =
let rec loop acc =
match input_line channel with
| exception End_of_file -> acc