From d52a846d9bb3263fc6bc645051ccbf2b69a6767e Mon Sep 17 00:00:00 2001 From: Yasunari Watanabe Date: Mon, 22 Apr 2024 14:46:06 +0800 Subject: [PATCH] don't prefix Stdlib --- lib/api_local.ml | 2 -- lib/api_remote.ml | 6 +++--- lib/context.ml | 1 - lib/github.ml | 2 +- src/monorobot.ml | 5 ++--- test/test.ml | 2 -- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/api_local.ml b/lib/api_local.ml index a5e9c586..d09cbde6 100644 --- a/lib/api_local.ml +++ b/lib/api_local.ml @@ -1,8 +1,6 @@ open Common open Devkit open Printf -module Filename = Stdlib.Filename -module Sys = Stdlib.Sys let cwd = Sys.getcwd () let github_cache_dir = Filename.concat cwd "github-api-cache" diff --git a/lib/api_remote.ml b/lib/api_remote.ml index 2ec1b58b..ea8cd5b5 100644 --- a/lib/api_remote.ml +++ b/lib/api_remote.ml @@ -127,7 +127,7 @@ module Slack : Api.Slack = struct (* must read whole response to update lexer state *) ignore (Slack_j.read_ok_res s l) - let lookup_user_cache = Stdlib.Hashtbl.create 50 + let lookup_user_cache = Hashtbl.create 50 let lookup_user' ~(ctx : Context.t) ~(cfg : Config_t.config) ~email () = (* Check if config holds the Github to Slack email mapping *) @@ -140,7 +140,7 @@ module Slack : Api.Slack = struct with | Error _ as e -> Lwt.return e | Ok user -> - Stdlib.Hashtbl.replace lookup_user_cache email user; + Hashtbl.replace lookup_user_cache email user; Lwt.return_ok user (** [lookup_user cfg email] queries slack for a user profile with [email] *) @@ -148,7 +148,7 @@ module Slack : Api.Slack = struct match cache with | `Refresh -> lookup_user' ~ctx ~cfg ~email () | `Use -> - match Stdlib.Hashtbl.find_opt lookup_user_cache email with + match Hashtbl.find_opt lookup_user_cache email with | Some user -> Lwt.return_ok user | None -> lookup_user' ~ctx ~cfg ~email () diff --git a/lib/context.ml b/lib/context.ml index 68e1de39..db64a269 100644 --- a/lib/context.ml +++ b/lib/context.ml @@ -1,6 +1,5 @@ open Common open Devkit -module Sys = Stdlib.Sys let log = Log.from "context" diff --git a/lib/github.ml b/lib/github.ml index b209a30a..59ca48e2 100644 --- a/lib/github.ml +++ b/lib/github.ml @@ -25,7 +25,7 @@ let repo_of_notification = function | Status n -> n.repository let commits_branch_of_ref ref = - match Stdlib.String.split_on_char '/' ref with + match String.split_on_char '/' ref with | "refs" :: "heads" :: l -> String.concat "/" l | _ -> ref diff --git a/src/monorobot.ml b/src/monorobot.ml index 20ab65f0..177714d1 100644 --- a/src/monorobot.ml +++ b/src/monorobot.ml @@ -1,7 +1,6 @@ open Devkit open Lib open Cmdliner -module Filename = Stdlib.Filename let log = Log.from "monorobot" @@ -9,7 +8,7 @@ let log = Log.from "monorobot" let http_server_action addr port config secrets state logfile loglevel = Daemon.logfile := logfile; - Stdlib.Option.iter Log.set_loglevels loglevel; + Option.may Log.set_loglevels loglevel; Log.reopen !Daemon.logfile; Signal.setup_lwt (); Daemon.install_signal_handlers (); @@ -145,4 +144,4 @@ let default, info = let () = let cmds = [ run; check_gh; check_slack ] in let group = Cmd.group ~default info cmds in - Stdlib.exit @@ Cmd.eval group + exit @@ Cmd.eval group diff --git a/test/test.ml b/test/test.ml index 388523d9..e807d2c5 100644 --- a/test/test.ml +++ b/test/test.ml @@ -1,7 +1,5 @@ open Devkit open Lib -module Filename = Stdlib.Filename -module Sys = Stdlib.Sys let log = Log.from "test" let mock_payload_dir = Filename.concat Filename.parent_dir_name "mock_payloads"