[infra] Update yojson and fix deprecations

Summary:
Update yojson (1.4.1 -> 1.7.0). Yojson.Basic.json is deprecated in
favor of Yojson.Basic.t. These deprecations warnings are fixed.

Reviewed By: mityal

Differential Revision: D15964194

fbshipit-source-id: 1b09fd19f
master
Artem Pianykh 5 years ago committed by Facebook Github Bot
parent c5f261e977
commit 39dce8878f

@ -131,7 +131,7 @@ type t =
{ introduced: Jsonbug_t.report
; fixed: Jsonbug_t.report
; preexisting: Jsonbug_t.report
; costs_summary: Yojson.Basic.json }
; costs_summary: Yojson.Basic.t }
let to_map key_func report =
List.fold_left

@ -11,7 +11,7 @@ type t =
{ introduced: Jsonbug_t.report
; fixed: Jsonbug_t.report
; preexisting: Jsonbug_t.report
; costs_summary: Yojson.Basic.json }
; costs_summary: Yojson.Basic.t }
val of_reports :
current_report:Jsonbug_t.report

@ -24,9 +24,9 @@ type stats_type =
| Reporting
| Driver
val from_json : Yojson.Basic.json -> perf_stats
val from_json : Yojson.Basic.t -> perf_stats
val aggregate : perf_stats list -> Yojson.Basic.json
val aggregate : perf_stats list -> Yojson.Basic.t
val register_report : stats_kind -> stats_type -> unit
(** Register performance reporting function *)

@ -108,9 +108,9 @@ let aggregate_stats_files paths =
type json_aggregated_stats =
{ frontend_json_data: Yojson.Basic.json option
; backend_json_data: Yojson.Basic.json option
; reporting_json_data: Yojson.Basic.json option }
{ frontend_json_data: Yojson.Basic.t option
; backend_json_data: Yojson.Basic.t option
; reporting_json_data: Yojson.Basic.t option }
let aggregate_all_stats origin =
let accumulate_paths acc paths =

@ -218,7 +218,7 @@ let patterns_of_json_with_key (json_key, json) =
error
in
(* Translate a JSON entry into a matching pattern *)
let create_pattern (assoc : (string * Yojson.Basic.json) list) =
let create_pattern (assoc : (string * Yojson.Basic.t) list) =
let create_method_pattern assoc =
let loop mp = function
| key, `String s when String.equal key "class" ->

@ -98,7 +98,7 @@ type desc =
; doc: string
; spec: spec
(** how to go from an option in the json config file to a list of command-line options *)
; decode_json: inferconfig_dir:string -> Yojson.Basic.json -> string list }
; decode_json: inferconfig_dir:string -> Yojson.Basic.t -> string list }
let dashdash ?short long =
match (long, short) with

@ -134,7 +134,7 @@ val mk_symbol_seq :
[<symbol sequence>] is a comma-separated sequence of [<symbol>]s such that [(<symbol>,_)] is an
element of [symbols]. *)
val mk_json : Yojson.Basic.json ref t
val mk_json : Yojson.Basic.t ref t
val mk_anon : unit -> string list ref
(** [mk_anon ()] defines a [string list ref] of the anonymous command line arguments, in the reverse

@ -133,13 +133,13 @@ val os_type : os_type
val passthroughs : bool
val patterns_modeled_expensive : string * Yojson.Basic.json
val patterns_modeled_expensive : string * Yojson.Basic.t
val patterns_never_returning_null : string * Yojson.Basic.json
val patterns_never_returning_null : string * Yojson.Basic.t
val patterns_skip_implementation : string * Yojson.Basic.json
val patterns_skip_implementation : string * Yojson.Basic.t
val patterns_skip_translation : string * Yojson.Basic.json
val patterns_skip_translation : string * Yojson.Basic.t
val perf_stats_prefix : string
@ -225,11 +225,11 @@ val analysis_suppress_errors : string list
val annotation_reachability : bool
val annotation_reachability_cxx : Yojson.Basic.json
val annotation_reachability_cxx : Yojson.Basic.t
val annotation_reachability_cxx_sources : Yojson.Basic.json
val annotation_reachability_cxx_sources : Yojson.Basic.t
val annotation_reachability_custom_pairs : Yojson.Basic.json
val annotation_reachability_custom_pairs : Yojson.Basic.t
val anon_args : string list
@ -312,7 +312,7 @@ val cxx : bool
val cxx_infer_headers : bool
val cxx_scope_guards : Yojson.Basic.json
val cxx_scope_guards : Yojson.Basic.t
val debug_exceptions : bool
@ -469,7 +469,7 @@ val litho : bool
val liveness : bool
val liveness_dangerous_classes : Yojson.Basic.json
val liveness_dangerous_classes : Yojson.Basic.t
val log_events : bool
@ -570,13 +570,13 @@ val pure_by_default : bool
val quandary : bool
val quandary_endpoints : Yojson.Basic.json
val quandary_endpoints : Yojson.Basic.t
val quandary_sanitizers : Yojson.Basic.json
val quandary_sanitizers : Yojson.Basic.t
val quandary_sinks : Yojson.Basic.json
val quandary_sinks : Yojson.Basic.t
val quandary_sources : Yojson.Basic.json
val quandary_sources : Yojson.Basic.t
val quandaryBO : bool
@ -656,7 +656,7 @@ val sqlite_vfs : string option
val starvation : bool
val starvation_skip_analysis : Yojson.Basic.json
val starvation_skip_analysis : Yojson.Basic.t
val starvation_strict_mode : bool
@ -676,7 +676,7 @@ val test_filtering : bool
val testing_mode : bool
val threadsafe_aliases : Yojson.Basic.json
val threadsafe_aliases : Yojson.Basic.t
val topl_properties : string list

@ -50,7 +50,7 @@ val directory_iter : (string -> unit) -> string -> unit
val directory_is_empty : string -> bool
(** Returns true if a given directory is empty. The directory is assumed to exist. *)
val read_json_file : string -> (Yojson.Basic.json, string) Result.t
val read_json_file : string -> (Yojson.Basic.t, string) Result.t
val with_file_in : string -> f:(In_channel.t -> 'a) -> 'a
@ -59,7 +59,7 @@ val with_file_out : string -> f:(Out_channel.t -> 'a) -> 'a
val with_intermediate_temp_file_out : string -> f:(Out_channel.t -> 'a) -> 'a
(** like [with_file_out] but uses a fresh intermediate temporary file and rename to avoid write-write races *)
val write_json_to_file : string -> Yojson.Basic.json -> unit
val write_json_to_file : string -> Yojson.Basic.t -> unit
val consume_in : In_channel.t -> unit
(** consume and ignore all the lines from the channel until End_of_file is reached *)
@ -114,20 +114,20 @@ val strip_balanced_once : drop:(char -> bool) -> string -> string
string; for instance, [strip_balanced ~drop:(function | 'a' | 'x' -> true | _ -> false) "xaabax"]
returns "aaba" *)
val assoc_of_yojson : Yojson.Basic.json -> src:string -> (string, Yojson.Basic.json) List.Assoc.t
val assoc_of_yojson : Yojson.Basic.t -> src:string -> (string, Yojson.Basic.t) List.Assoc.t
(** Verify we have a json object (or empty list) and return the corresponding assoc list. Otherwise die with a message including src. *)
val string_of_yojson : Yojson.Basic.json -> src:string -> string
val string_of_yojson : Yojson.Basic.t -> src:string -> string
(** Verify we have a json string and return the corresponding ocaml string. Otherwise die with a message including src. *)
val string_list_of_yojson : Yojson.Basic.json -> src:string -> string list
val string_list_of_yojson : Yojson.Basic.t -> src:string -> string list
(** Verify we have a json list of strings and return the corresponding ocaml string list. Otherwise die with a message including src. *)
val yojson_lookup :
(string, Yojson.Basic.json) List.Assoc.t
(string, Yojson.Basic.t) List.Assoc.t
-> string
-> src:string
-> f:(Yojson.Basic.json -> src:string -> 'a)
-> f:(Yojson.Basic.t -> src:string -> 'a)
-> default:'a
-> 'a
(** Lookup a json value on an assoc list. If not present, returns default. Otherwise returns (f json_value ~src) where src has element name appended. f is typically one of the above _of_yojson functions. *)

@ -17,4 +17,4 @@ exception ALFileException of exc_info
val create_exc_info : string -> Lexing.lexbuf -> exc_info
val json_of_exc_info : exc_info -> Yojson.Basic.json
val json_of_exc_info : exc_info -> Yojson.Basic.t

@ -7,7 +7,7 @@
open! IStd
(** pattern matcher for Java/C++ methods
(** pattern matcher for Java/C++ methods
NB matching is modulo template arguments in C++ classes and functions *)
type t = Tenv.t -> Typ.Procname.t -> HilExp.t list -> bool
@ -25,7 +25,7 @@ val default : record
val of_record : record -> t
(** make a matcher out of a record; optional values use defaults *)
val of_json : Yojson.Basic.json -> t
val of_json : Yojson.Basic.t -> t
(** Parse a JSon object into a matcher. The Json object must be a list of records, each
corresponding to a single matcher. Each record must have a ["classname"] field with a [string]
value, and a ["methods"] field with a list of strings. The record may also have boolean

@ -9,6 +9,6 @@ open! IStd
type t
val to_json : t -> Yojson.Basic.json
val to_json : t -> Yojson.Basic.t
val compute_statistics : float list -> t option

@ -12,19 +12,19 @@ open! IStd
module Source : sig
type t = {procedure: string; kinds: string list; index: string}
val of_json : [> `List of Yojson.Basic.json list] -> t list
val of_json : [> `List of Yojson.Basic.t list] -> t list
end
module Sink : sig
type t = {procedure: string; kinds: string list; index: string}
val of_json : [> `List of Yojson.Basic.json list] -> t list
val of_json : [> `List of Yojson.Basic.t list] -> t list
end
module Sanitizer : sig
type t = {procedure: string; kind: string}
val of_json : [> `List of Yojson.Basic.json list] -> t list
val of_json : [> `List of Yojson.Basic.t list] -> t list
end
val is_endpoint : string -> bool

@ -47,7 +47,7 @@ depends: [
"sqlite3"
"utop" {with-test}
"xmlm" {>="1.2.0"}
"yojson" {<"1.6.0"}
"yojson" {>="1.7.0"}
"zarith" {>="1.7"}
]
depexts: [

@ -120,7 +120,7 @@ depends: [
"typerep" {= "v0.11.0"}
"variantslib" {= "v0.11.0"}
"xmlm" {= "1.3.0"}
"yojson" {= "1.4.1"}
"yojson" {= "1.7.0"}
"zarith" {= "1.7"}
]
depexts: [

Loading…
Cancel
Save