Skip to content

Commit

Permalink
Upgrade ocamlformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Oct 30, 2023
1 parent 1b59132 commit 6ada868
Show file tree
Hide file tree
Showing 2,178 changed files with 1,924 additions and 12,604 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.19.0
version=0.24.1
break-cases=toplevel
break-fun-decl=fit-or-vertical
break-infix=fit-or-vertical
Expand Down
28 changes: 0 additions & 28 deletions lib/aws.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ module Xml = struct
try Some (Ezxmlm.member tag xml) with Ezxmlm.Tag_not_found _ -> None

let members tag xml = try Ezxmlm.members tag xml with Ezxmlm.Tag_not_found _ -> []

let data_to_string = Ezxmlm.data_to_string

let required nm a =
Expand Down Expand Up @@ -207,19 +206,13 @@ end

module type Call = sig
type input

type output

type error

val signature_version : Request.signature_version

val service : string

val to_http : string -> string -> input -> Request.t

val of_http : string -> [ `Ok of output | `Error of error Error.error_response ]

val parse_error : int -> string -> error option
end

Expand All @@ -231,11 +224,8 @@ module Time = struct
module P = CalendarLib.Printer.Calendar

let date_yymmdd = P.sprint "%Y%m%d"

let date_time_iso8601 = P.sprint "%Y-%m-%dT%H:%M:%S"

let date_time = P.sprint "%Y%m%dT%H%M%SZ"

let now_utc () = C.(now () |> to_gmt)

(* (tmcgilchrist) This function is expecting datetimes like
Expand Down Expand Up @@ -328,15 +318,10 @@ module BaseTypes = struct
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

Expand All @@ -350,11 +335,8 @@ module BaseTypes = struct
| t -> raise (Json.Casting_error ("unit", t))

let to_query () = List []

let parse _ = Some () (* XXX(seliopou): Should never be used, maybe assert that? *)

let to_string _ = raise (Failure "unit")

let of_string _ = raise (Failure "unit")
end

Expand All @@ -368,11 +350,8 @@ module BaseTypes = struct
| t -> raise (Json.Casting_error ("string", t))

let to_query s = Value (Some s)

let parse s = Some (data_to_string s)

let to_string s = s

let of_string s = s
end

Expand Down Expand Up @@ -429,7 +408,6 @@ module BaseTypes = struct
| Some s -> ( try Some (int_of_string s) with Failure _ -> None)

let to_string i = string_of_int i

let of_string s = int_of_string s
end

Expand All @@ -452,7 +430,6 @@ module BaseTypes = struct
| Some s -> ( try Some (float_of_string s) with Failure _ -> None)

let to_string f = string_of_float f

let of_string s = float_of_string s
end

Expand All @@ -462,9 +439,7 @@ module BaseTypes = struct
type t = CalendarLib.Calendar.t

let to_json c = `String (Time.format c)

let of_json t = Time.parse (String.of_json t)

let to_query c = Value (Some (Time.format c))

let parse c =
Expand All @@ -473,7 +448,6 @@ module BaseTypes = struct
| Some s -> ( try Some (Time.parse s) with Invalid_argument _ -> None)

let to_string c = Time.format c

let of_string s = Time.parse s
end
end
Expand All @@ -488,9 +462,7 @@ module Signing = struct
| None -> Digestif.SHA256.digest_string str

let sha256 ?key str = _sha256 ?key str |> Digestif.SHA256.to_raw_string

let sha256_hex ?key str = _sha256 ?key str |> Digestif.SHA256.to_hex

let sha256_base64 ?key str = Base64.encode_string @@ sha256 ?key str
end

Expand Down
17 changes: 0 additions & 17 deletions lib/aws.mli
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ module Time : sig
format. *)

val date_time_iso8601 : CalendarLib.Calendar.t -> string

val now_utc : unit -> CalendarLib.Calendar.t

val format : CalendarLib.Calendar.t -> string
Expand Down Expand Up @@ -291,11 +290,8 @@ end
module Signing : sig
module Hash : sig
val _sha256 : ?key:string -> string -> Digestif.SHA256.t

val sha256 : ?key:string -> string -> string

val sha256_hex : ?key:string -> string -> string

val sha256_base64 : ?key:string -> string -> string
end

Expand Down Expand Up @@ -352,34 +348,21 @@ module BaseTypes : sig
type t

val to_json : t -> Json.t

val of_json : Json.t -> t

val to_query : t -> Query.t

val parse : Ezxmlm.nodes -> t option

val to_string : t -> string

val of_string : string -> t
end

module Unit : Base with type t = unit

module String : Base with type t = string

module Blob : Base with type t = string

module Boolean : Base with type t = bool

module Integer : Base with type t = int

module Long : Base with type t = int

module Double : Base with type t = float

module Float : Base with type t = float

module DateTime : Base with type t = CalendarLib.Calendar.t
end

Expand Down
Loading

0 comments on commit 6ada868

Please sign in to comment.