Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

monopam: code style cleanups

Minor formatting and style improvements from linter.

+52 -23
+1 -2
lib/changes.ml
··· 835 835 result := 836 836 Some 837 837 (Error 838 - (Printf.sprintf "Claude error: %s" 839 - (Claude.Response.Error.message e))) 838 + (Fmt.str "Claude error: %s" (Claude.Response.Error.message e))) 840 839 | _ -> ()) 841 840 responses; 842 841
+4
lib/changes_aggregated.ml
··· 63 63 authors : string list; 64 64 } 65 65 66 + let pp ppf t = 67 + Fmt.pf ppf "@[<v>date: %s@ entries: %d@ authors: %d@]" t.date 68 + (List.length t.entries) (List.length t.authors) 69 + 66 70 (* JSON codecs *) 67 71 68 72 let change_type_jsont =
+3
lib/changes_aggregated.mli
··· 60 60 } 61 61 (** The complete aggregated daily changes file. *) 62 62 63 + val pp : t Fmt.t 64 + (** Pretty-printer for aggregated changes. *) 65 + 63 66 (** {1 JSON Codecs} *) 64 67 65 68 val jsont : t Jsont.t
+6
lib/changes_daily.ml
··· 33 33 all_entries : entry list; 34 34 } 35 35 36 + let pp ppf t = 37 + Fmt.pf ppf "@[<v>repos: %d@ dates: %d@ entries: %d@]" 38 + (String_map.cardinal t.by_repo) 39 + (String_map.cardinal t.by_date) 40 + (List.length t.all_entries) 41 + 36 42 (* JSON codecs for the per-day file format *) 37 43 38 44 let commit_range_jsont =
+3
lib/changes_daily.mli
··· 46 46 } 47 47 (** Immutable collection of all loaded daily changes. *) 48 48 49 + val pp : t Fmt.t 50 + (** Pretty-printer for daily changes. *) 51 + 49 52 (** {1 Construction} *) 50 53 51 54 val empty : t
+3 -4
lib/doctor.ml
··· 849 849 { 850 850 action_priority = Medium; 851 851 description = 852 - Printf.sprintf "Run monopam sync to resolve %d local sync issues" 852 + Fmt.str "Run monopam sync to resolve %d local sync issues" 853 853 repos_need_sync; 854 854 command = Some "monopam sync"; 855 855 } ··· 865 865 { 866 866 action_priority = Medium; 867 867 description = 868 - Printf.sprintf "Pull upstream changes for %d repos" 869 - repos_behind_upstream; 868 + Fmt.str "Pull upstream changes for %d repos" repos_behind_upstream; 870 869 command = Some "monopam sync"; 871 870 } 872 871 :: !recommendations; ··· 1011 1010 Jsont_bytesrw.encode_string ~format:Jsont.Indent report_jsont report 1012 1011 with 1013 1012 | Ok s -> s 1014 - | Error e -> failwith (Printf.sprintf "Failed to encode report: %s" e) 1013 + | Error e -> Fmt.failwith "Failed to encode report: %s" e 1015 1014 1016 1015 (** {1 Health Status} *) 1017 1016
+5
lib/dune_project.ml
··· 14 14 packages : string list; 15 15 } 16 16 17 + let pp ppf t = 18 + Fmt.pf ppf "@[<v>name: %s@ packages: [%a]@]" t.name 19 + Fmt.(list ~sep:(any ", ") string) 20 + t.packages 21 + 17 22 module Sexp = Sexplib0.Sexp 18 23 19 24 (** Extract string from a Sexp.Atom, or None if it's a List *)
+3
lib/dune_project.mli
··· 18 18 } 19 19 (** Parsed dune-project file. *) 20 20 21 + val pp : t Fmt.t 22 + (** Pretty-printer for parsed dune-project. *) 23 + 21 24 val parse : string -> (t, string) result 22 25 (** [parse content] parses a dune-project file content and extracts metadata. 23 26 Returns [Error msg] if parsing fails or required fields are missing. *)
+2 -2
lib/feature.ml
··· 14 14 | Git_error _ -> Some "Check that the monorepo is properly initialized" 15 15 | Feature_exists name -> 16 16 Some 17 - (Printf.sprintf 17 + (Fmt.str 18 18 "Run 'monopam feature remove %s' first if you want to recreate it" 19 19 name) 20 20 | Feature_not_found name -> 21 21 Some 22 - (Printf.sprintf 22 + (Fmt.str 23 23 "Run 'monopam feature list' to see available features, or 'monopam \ 24 24 feature add %s' to create it" 25 25 name)
+3 -3
lib/fork_join.ml
··· 280 280 String.sub path 1 (String.length path - 1) 281 281 else path 282 282 in 283 - Printf.sprintf "git@github.com:%s" path 283 + Fmt.str "git@github.com:%s" path 284 284 | Some ("https" | "http"), Some "gitlab.com" -> 285 285 (* https://gitlab.com/user/repo.git -> git@gitlab.com:user/repo.git *) 286 286 let path = ··· 288 288 String.sub path 1 (String.length path - 1) 289 289 else path 290 290 in 291 - Printf.sprintf "git@gitlab.com:%s" path 291 + Fmt.str "git@gitlab.com:%s" path 292 292 | Some ("https" | "http"), _ when is_tangled_host host -> 293 293 (* https://tangled.sh/@handle/repo -> git@<knot>:handle/repo *) 294 294 let path = ··· 310 310 in 311 311 (* Use provided knot or default to git.recoil.org *) 312 312 let knot_server = Option.value ~default:"git.recoil.org" knot in 313 - Printf.sprintf "git@%s:%s" knot_server path 313 + Fmt.str "git@%s:%s" knot_server path 314 314 | _ -> 315 315 (* Return original URL for other cases *) 316 316 url
+1 -1
lib/git_cli.ml
··· 3 3 (** Read user info from global git config. *) 4 4 let global_git_user () = 5 5 let read_config key = 6 - let ic = Unix.open_process_in (Printf.sprintf "git config %s" key) in 6 + let ic = Unix.open_process_in (Fmt.str "git config %s" key) in 7 7 let value = 8 8 try Some (String.trim (input_line ic)) with End_of_file -> None 9 9 in
+1
lib/monorepo_pkg.ml
··· 12 12 opam_content : string; 13 13 } 14 14 15 + let pp ppf t = Fmt.pf ppf "@[<v>%s (subtree: %s)@]" t.pkg_name t.subtree 15 16 let name t = t.pkg_name 16 17 let subtree t = t.subtree 17 18 let dev_repo t = t.dev_repo
+3
lib/monorepo_pkg.mli
··· 8 8 opam_content : string; 9 9 } 10 10 11 + val pp : t Fmt.t 12 + (** Pretty-printer for monorepo package. *) 13 + 11 14 val name : t -> string 12 15 (** Package name from the opam file. *) 13 16
+3 -3
lib/opam_repo.ml
··· 206 206 (fun line -> 207 207 let trimmed = String.trim line in 208 208 if String.starts_with ~prefix:"dev-repo:" trimmed then 209 - Printf.sprintf {|dev-repo: "%s"|} dev_repo_url 209 + Fmt.str {|dev-repo: "%s"|} dev_repo_url 210 210 else line) 211 211 lines 212 212 in ··· 236 236 if String.starts_with ~prefix:"}" trimmed then 237 237 (* End of url block - output our replacement *) 238 238 let replacement = 239 - [ "url {"; Printf.sprintf {| src: "%s"|} url_src; "}" ] 239 + [ "url {"; Fmt.str {| src: "%s"|} url_src; "}" ] 240 240 in 241 241 process rest false (List.rev_append replacement acc) 242 242 else ··· 248 248 if String.ends_with ~suffix:"}" trimmed then 249 249 (* Single-line url block *) 250 250 let replacement = 251 - [ "url {"; Printf.sprintf {| src: "%s"|} url_src; "}" ] 251 + [ "url {"; Fmt.str {| src: "%s"|} url_src; "}" ] 252 252 in 253 253 process rest false (List.rev_append replacement acc) 254 254 else process rest true acc
+3
lib/remote_cache.ml
··· 26 26 type entry = { hash : string; expires : float } 27 27 type t = { tbl : (string, entry) Hashtbl.t; ttl : float; now : unit -> float } 28 28 29 + let pp ppf t = 30 + Fmt.pf ppf "@[<v>cache: %d entries, ttl: %.0fs@]" (Hashtbl.length t.tbl) t.ttl 31 + 29 32 let default_ttl = 300.0 (* 5 minutes *) 30 33 let key url branch = Fmt.str "%s:%s" (Uri.to_string url) branch 31 34
+3
lib/remote_cache.mli
··· 39 39 type t 40 40 (** The cache type. *) 41 41 42 + val pp : t Fmt.t 43 + (** Pretty-printer for the cache (shows size and TTL). *) 44 + 42 45 val default_ttl : float 43 46 (** Default TTL in seconds (300.0 = 5 minutes). *) 44 47
+3 -6
lib/sources_registry.ml
··· 57 57 ~dec:(function 58 58 | "fork" -> Fork 59 59 | "join" -> Join 60 - | s -> 61 - failwith 62 - (Printf.sprintf "Invalid origin: %s (expected 'fork' or 'join')" s)) 60 + | s -> Fmt.failwith "Invalid origin: %s (expected 'fork' or 'join')" s) 63 61 ~enc:(function Fork -> "fork" | Join -> "join") 64 62 Tomlt.string 65 63 ··· 90 88 match Eio.Path.kind ~follow:true eio_path with 91 89 | `Regular_file -> ( 92 90 try Ok (Tomlt_eio.decode_path_exn codec ~fs path_str) with 93 - | Failure msg -> Error (Printf.sprintf "Invalid sources.toml: %s" msg) 91 + | Failure msg -> Error (Fmt.str "Invalid sources.toml: %s" msg) 94 92 | exn -> 95 93 Error 96 - (Printf.sprintf "Error loading sources.toml: %s" 97 - (Printexc.to_string exn))) 94 + (Fmt.str "Error loading sources.toml: %s" (Printexc.to_string exn))) 98 95 | _ -> Ok empty (* File doesn't exist, return empty registry *) 99 96 | exception _ -> Ok empty 100 97
+2 -2
lib/sync_progress.ml
··· 13 13 } 14 14 15 15 let create ~total phase_name = 16 - let msg = Printf.sprintf "%s (0/%d)" phase_name total in 16 + let msg = Fmt.str "%s (0/%d)" phase_name total in 17 17 let progress = Tty.Progress.create ~total msg in 18 18 { progress; completed = Atomic.make 0; total; phase_name } 19 19 20 20 let tick t name = 21 21 let n = Atomic.fetch_and_add t.completed 1 + 1 in 22 - let msg = Printf.sprintf "%s: %s (%d/%d)" t.phase_name name n t.total in 22 + let msg = Fmt.str "%s: %s (%d/%d)" t.phase_name name n t.total in 23 23 Tty.Progress.message t.progress msg; 24 24 Tty.Progress.set t.progress n 25 25