Skip to content

Commit

Permalink
upgrade ocamlformat 0.26.1
Browse files Browse the repository at this point in the history
Summary: Seems like a net positive.

Reviewed By: geralt-encore

Differential Revision:
D55069652

Privacy Context Container: L1208441

fbshipit-source-id: c9dd40cb1daf9bf381cf5fd9ba6673b42a7e0ee5
  • Loading branch information
jvillard authored and facebook-github-bot committed Mar 21, 2024
1 parent 430dc69 commit 79dd713
Show file tree
Hide file tree
Showing 89 changed files with 230 additions and 241 deletions.
2 changes: 1 addition & 1 deletion infer/src/.ocamlformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ocaml-version = 4.14
version = 0.25.1
version = 0.26.1
profile = ocamlformat
break-before-in = fit-or-vertical
break-sequences = true
Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Exp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ and t =
| Lvar of Pvar.t (** The address of a program variable *)
| Lfield of t * Fieldname.t * Typ.t
(** A field offset, the type is the surrounding struct type *)
| Lindex of t * t (** An array index offset: [exp1\[exp2\]] *)
| Lindex of t * t (** An array index offset: [exp1[exp2]] *)
| Sizeof of sizeof_data
[@@deriving compare, equal, hash, normalize]

Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Exp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ and t =
| Lvar of Pvar.t (** The address of a program variable *)
| Lfield of t * Fieldname.t * Typ.t
(** A field offset, the type is the surrounding struct type *)
| Lindex of t * t (** An array index offset: [exp1\[exp2\]] *)
| Lindex of t * t (** An array index offset: [exp1[exp2]] *)
| Sizeof of sizeof_data
[@@deriving compare, hash, normalize]

Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Fieldname.mli
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ val is_capture_field_in_closure_by_ref : t -> bool
val is_java : t -> bool

val is_java_synthetic : t -> bool
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** Check if the field is autogenerated/synthetic **)

val is_internal : t -> bool
Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Instrs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type reversed
type not_reversed

(** [Empty] and [Singleton _] can have both directions. We do not attempt to make the representation
canonic, e.g. [NotReversed \[||\]], [Reversed \[||\]], and [Empty] are all allowed despite
canonic, e.g. [NotReversed [||]], [Reversed [||]], and [Empty] are all allowed despite
representing the same value. *)
type _ t =
| NotReversed : Sil.instr Array.t -> not_reversed t
Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Instrs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ val concat_map_and_fold :
by threading an accumulator. Preserve physical equality. **)

val concat_map : not_reversed t -> f:(Sil.instr -> Sil.instr array) -> not_reversed t
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** replace every instruction [instr] with the list [f instr]. Preserve physical equality. **)

val reverse_order : not_reversed t -> reversed t
Expand Down
4 changes: 2 additions & 2 deletions infer/src/IR/ProcAttributes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type specialized_with_aliasing_info =
{ orig_proc: Procname.t
; aliases: Pvar.t list list
(** all the pvars in a same list are aliasing each other. e.g.
[aliases = \[\[x; y; z\]; \[a; b\]\]] indicates that [x], [y] and [z] alias each other
and [a] and [b] as well *) }
[aliases = [[x; y; z]; [a; b]]] indicates that [x], [y] and [z] alias each other and [a]
and [b] as well *) }
[@@deriving compare]

type 'captured_var passed_closure =
Expand Down
4 changes: 2 additions & 2 deletions infer/src/IR/Procdesc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ module Node : sig
val pp_stmt : Format.formatter -> stmt_nodekind -> unit

val pp_with_instrs : ?print_types:bool -> Format.formatter -> t -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** Pretty print the node with instructions *)

val compute_key : t -> NodeKey.t
Expand Down Expand Up @@ -360,7 +360,7 @@ val pp_signature : Format.formatter -> t -> unit
val pp_local : Format.formatter -> ProcAttributes.var_data -> unit

val pp_with_instrs : ?print_types:bool -> Format.formatter -> t -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]

val is_specialized : t -> bool

Expand Down
6 changes: 3 additions & 3 deletions infer/src/IR/PythonClassName.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ val pp : F.formatter -> t -> unit
val to_string : t -> string

val static_companion : t -> t
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** return the class of the companion class object of this class eg: Foo -> Foo$static *)

val static_companion_origin : t -> t
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** return the origin class of a companion class object eg: Foo$static -> Foo. the result is not
specified if is the name is not a valid static class name *)

val is_static : t -> bool
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** tests if the name is a valid static class name (ie. ends with "$static") *)
2 changes: 1 addition & 1 deletion infer/src/IR/Specialization.mli
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module Pulse : sig
(** currently [aliases=None] means we did not detect any alias when applying the previous summary
and this specialization will not introduce any alias assumption.
[aliases=Some \[\]] means something went wrong... We have detected some aliases when applying
[aliases=Some []] means something went wrong... We have detected some aliases when applying
the last summary, but we were not able to phrase it in term of parameters equalities. *)
type t = {aliases: Aliases.t option; dynamic_types: DynamicTypes.t} [@@deriving equal, compare]

Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Tenv.mli
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ val create : unit -> t
(** Create a new type environment. *)

val load : SourceFile.t -> t option
[@@alert tenv "Analysis code should use [Exe_env.get_source_tenv] instead."]
[@@alert tenv "Analysis code should use [Exe_env.get_source_tenv] instead."]
(** Load a type environment for a source file *)

val store_debug_file_for_source : SourceFile.t -> t -> unit
Expand Down
2 changes: 1 addition & 1 deletion infer/src/IR/Typ.mli
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ and template_spec_info =
; args: template_arg list }

val pp_template_spec_info : Pp.env -> F.formatter -> template_spec_info -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]

val is_template_spec_info_empty : template_spec_info -> bool

Expand Down
12 changes: 6 additions & 6 deletions infer/src/absint/AbstractInterpreter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct


module Domain = struct
(** a list [\[x1; x2; ...; xN\]] represents a disjunction [x1 ∨ x2 ∨ ... ∨ xN] *)
(** a list [[x1; x2; ...; xN]] represents a disjunction [x1 ∨ x2 ∨ ... ∨ xN] *)
type t = T.DisjDomain.t list * T.NonDisjDomain.t

(** [append_no_duplicates_up_to leq ~limit from ~into ~into_length] is a triple where
Expand Down Expand Up @@ -441,10 +441,10 @@ struct
let ((disjuncts, non_disj_astates), _), need_join_non_disj =
List.foldi (List.rev pre) ~init:(current_post_n, false)
~f:(fun
i
((((post, non_disj_astate) as post_astate), n_disjuncts), need_join_non_disj)
pre_disjunct
->
i
((((post, non_disj_astate) as post_astate), n_disjuncts), need_join_non_disj)
pre_disjunct
->
let limit = disjunct_limit - n_disjuncts in
AnalysisState.set_remaining_disjuncts limit ;
if limit <= 0 then (
Expand Down Expand Up @@ -722,7 +722,7 @@ module AbstractInterpreterCommon (TransferFunctions : NodeTransferFunctions) = s
(* shadowed for HTML debug *)
let compute_pre cfg node inv_map =
AnalysisCallbacks.html_debug_new_node_session (Node.underlying_node node) ~kind:`ComputePre
~pp_name:(TransferFunctions.pp_session_name node) ~f:(fun () -> compute_pre cfg node inv_map)
~pp_name:(TransferFunctions.pp_session_name node) ~f:(fun () -> compute_pre cfg node inv_map )


(** compute and return an invariant map for [pdesc] *)
Expand Down
2 changes: 1 addition & 1 deletion infer/src/absint/AccessPath.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ val append : t -> access list -> t

(* used in infer/src/labs/ *)
val replace_prefix : prefix:t -> replace_with:t -> t -> t option
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]

val equal_base : base -> base -> bool

Expand Down
2 changes: 1 addition & 1 deletion infer/src/absint/ExplicitTrace.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module type TraceElem = sig
val map : f:(elem_t -> elem_t) -> t -> t

val get_loc : t -> Location.t
(** Starting location of the trace: this is either [loc] if [trace==\[\]], or the head of [trace]. *)
(** Starting location of the trace: this is either [loc] if [trace==[]], or the head of [trace]. *)

val make_loc_trace : ?nesting:int -> t -> Errlog.loc_trace

Expand Down
2 changes: 1 addition & 1 deletion infer/src/absint/HilExp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module AccessExpression : sig
val array_offset : access_expression -> Typ.t -> t option -> access_expression

val address_of : access_expression -> access_expression option
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** address_of doesn't always make sense, eg [address_of (Dereference t)] is [None] *)

val address_of_base : AccessPath.base -> access_expression [@@warning "-unused-value-declaration"]
Expand Down
2 changes: 1 addition & 1 deletion infer/src/absint/MethodMatcher.mli
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type record =
; methods: string list }

val default : record
(** record encapsulating the default arguments of [call_matches]. [classname=""] and [methods=\[\]].
(** record encapsulating the default arguments of [call_matches]. [classname=""] and [methods=[]].
Useful for [with] expressions *)

val of_record : record -> t
Expand Down
3 changes: 1 addition & 2 deletions infer/src/backend/CallbackOfChecker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ let interprocedural_with_field_dependency ~dep_field payload_field checker
in
interprocedural ~f_analyze_dep:Option.some
~get_payload:(fun payloads ->
(Field.get payload_field payloads |> Lazy.force, Field.get dep_field payloads |> Lazy.force)
)
(Field.get payload_field payloads |> Lazy.force, Field.get dep_field payloads |> Lazy.force) )
~set_payload:(Field.fset payload_field) checker callbacks


Expand Down
2 changes: 1 addition & 1 deletion infer/src/backend/Payloads.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ module SQLite = struct
Sqlite3.bind_text load_stmt 1 proc_uid
|> SqliteUtils.check_result_code db ~log:"load payloads bind proc_uid" ;
SqliteUtils.result_option ~finalize:false db ~log:"load payloads exec" load_stmt
~read_row:(fun stmt -> Sqlite3.column stmt 0 |> deserialize_payload_opt |> Lazy.force) )
~read_row:(fun stmt -> Sqlite3.column stmt 0 |> deserialize_payload_opt |> Lazy.force ) )
|> Option.join


Expand Down
3 changes: 1 addition & 2 deletions infer/src/backend/StarvationGlobalAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ let report exe_env work_set =
Starvation.report_on_pair
~analyze_ondemand:(fun pname ->
Ondemand.analyze_proc_name exe_env ~caller_summary:summary pname
|> Option.bind ~f:(fun summary -> Lazy.force summary.Summary.payloads.starvation)
)
|> Option.bind ~f:(fun summary -> Lazy.force summary.Summary.payloads.starvation) )
tenv pattrs pair acc
in
Event.get_acquired_locks pair.elem.event
Expand Down
5 changes: 2 additions & 3 deletions infer/src/backend/ondemand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ let () =
AnalysisGlobalState.register ~save:Ident.NameGenerator.get_current
~restore:Ident.NameGenerator.set_current ~init:Ident.NameGenerator.reset ;
AnalysisGlobalState.register_ref_with_proc_desc_and_tenv Dependencies.currently_under_analysis
~init:(fun proc_desc _tenv -> Option.some (Procdesc.get_proc_name proc_desc)) ;
~init:(fun proc_desc _tenv -> Option.some (Procdesc.get_proc_name proc_desc) ) ;
()


Expand Down Expand Up @@ -324,8 +324,7 @@ let analyze_callee exe_env ~lazy_payloads ?specialization ?caller_summary
Timer.time Preanalysis
~f:(fun () ->
let caller_pname = caller_summary >>| fun summ -> summ.Summary.proc_name in
Some (run_proc_analysis exe_env tenv ?specialization ?caller_pname callee_pdesc)
)
Some (run_proc_analysis exe_env tenv ?specialization ?caller_pname callee_pdesc) )
~on_timeout:(fun span ->
L.debug Analysis Quiet
"TIMEOUT after %fs of CPU time analyzing %a:%a, outside of any checkers \
Expand Down
2 changes: 1 addition & 1 deletion infer/src/base/CommandLineOption.ml
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ let decode_env_to_argv env =
String.split ~on:env_var_sep env |> List.filter ~f:(Fn.non String.is_empty)
(** [prefix_before_rest (prefix @ \["--" :: rest\])] is [prefix] where "--" is not in [prefix]. *)
(** [prefix_before_rest (prefix @ ["--" :: rest])] is [prefix] where "--" is not in [prefix]. *)
let rev_prefix_before_rest args =
let rec rev_prefix_before_rest_ rev_keep = function
| [] | "--" :: _ ->
Expand Down
6 changes: 3 additions & 3 deletions infer/src/base/CommandLineOption.mli
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ val mk_string_list :
-> ?default_to_string:(string list -> string)
-> ?f:(string -> string)
-> string RevList.t ref t
(** [mk_string_list] defines a [string list ref], initialized to [\[\]] unless overridden by
(** [mk_string_list] defines a [string list ref], initialized to [[]] unless overridden by
[~default]. Each argument of an occurrence of the option will be prepended to the list, so the
final value will be in the reverse order they appeared on the command line.
Expand Down Expand Up @@ -143,7 +143,7 @@ val mk_symbol_seq :
val mk_json : Yojson.Basic.t ref t

val mk_anon : unit -> string RevList.t ref
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** [mk_anon ()] defines a [string list ref] of the anonymous command line arguments, in the reverse
order they appeared on the command line. *)

Expand Down Expand Up @@ -195,7 +195,7 @@ val mk_command_doc :
- [short_description] is a one-line description of the command
- [options] can be either [`Replace blocks], which populates the OPTIONS section with [blocks],
or [`Prepend blocks], in which case the options from the command are used, prepended by
[blocks]. If unspecified it defaults to [`Prepend \[\]].
[blocks]. If unspecified it defaults to [`Prepend []].
- All the other [section_name] options correspond to the contents of the section [section_name].
Some are mandatory and some are not. *)

Expand Down
4 changes: 2 additions & 2 deletions infer/src/base/DBWriter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module ServerSocket = struct

let socket_domain = Unix.domain_of_sockaddr socket_addr

(** Unix socket *paths* have a historical length limit of ~100 chars (!?*\@&*$). However, this
only applies to the argument passed in the system call to create the socket, not to the actual
(** Unix socket *paths* have a historical length limit of ~100 chars (!?*@&*$). However, this only
applies to the argument passed in the system call to create the socket, not to the actual
path. Thus a workaround is to cd into the parent dir of the socket and then use it, hence this
function. *)
let in_results_dir ~f = Utils.do_in_dir ~dir:Config.toplevel_results_dir ~f
Expand Down
8 changes: 4 additions & 4 deletions infer/src/base/Logging.mli
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ val debug : debug_kind -> debug_level -> ('a, F.formatter, unit) format -> 'a
(** log debug info *)

val debug_dev : ('a, Format.formatter, unit) format -> 'a
[@@deprecated
"Only use to debug during development. If you want more permanent logging, use [Logging.debug] \
instead."]
[@@warning "-unused-value-declaration"]
[@@deprecated
"Only use to debug during development. If you want more permanent logging, use [Logging.debug] \
instead."]
[@@warning "-unused-value-declaration"]
(** For debugging during development. *)

(** Type of location in ml source: __POS__ *)
Expand Down
8 changes: 4 additions & 4 deletions infer/src/base/MarkupFormatter.mli
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ val monospaced_to_string : string -> string
(** wrap into a monospaced block *)

val wrap_code : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** used to combine pp together, wrap content into a code block *)

val pp_code : Format.formatter -> string -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** pp to wrap into a code block *)

val wrap_bold : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** used to combine pp together, wrap content into a bold block *)

val pp_bold : Format.formatter -> string -> unit
(** pp to wrap into a bold block *)

val bold_to_string : string -> string
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** wrap into a bold block *)
2 changes: 1 addition & 1 deletion infer/src/base/PerfEvent.mli
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ val log_complete_event :
-> name:string
-> unit
-> unit
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]

val log_instant_event : logger -> ?timestamp:Mtime.t -> name:string -> scope -> unit

Expand Down
2 changes: 1 addition & 1 deletion infer/src/base/Serialization.mli
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ val write_to_file : 'a serializer -> data:'a -> DB.filename -> unit
(** Serialize into a file writing value *)

val generate_keys : unit -> int * int * int
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** Generate new (random) serialization keys, to be used in an ocaml toplevel *)
2 changes: 1 addition & 1 deletion infer/src/base/Utils.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ val normalize_path_from : root:string -> string -> string * string
represent the same file) *)

val normalize_path : string -> string
[@@warning "-unused-value-declaration"]
[@@warning "-unused-value-declaration"]
(** Normalize a path without a root *)

val flatten_path : ?sep:string -> string -> string
Expand Down
2 changes: 1 addition & 1 deletion infer/src/biabduction/Attribute.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ let find_arithmetic_problem tenv proc_node_session prop exp =
, e
, Some
( {Typ.desc= Tint (Typ.IUChar | Typ.IUInt | Typ.IUShort | Typ.IULong | Typ.IULongLong)}
as typ ) ) ->
as typ ) ) ->
uminus_unsigned := (e, typ) :: !uminus_unsigned
| Exp.UnOp (_, e, _) ->
walk e
Expand Down
3 changes: 1 addition & 2 deletions infer/src/biabduction/DotBiabduction.ml
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,7 @@ let rec dotty_mk_set_links dotnodes sigma p f cycle =
~f:(fun (k, lab_src, m, lab_trg) ->
mk_link k
(mk_coordinate (n + 1) lambda)
(strip_special_chars lab_src) (mk_coordinate m lambda) (strip_special_chars lab_trg)
)
(strip_special_chars lab_src) (mk_coordinate m lambda) (strip_special_chars lab_trg) )
target_list
in
let links_from_elements = List.concat_map ~f:ff (n :: nl) in
Expand Down
Loading

0 comments on commit 79dd713

Please sign in to comment.