diff --git a/infer/src/.ocamlformat b/infer/src/.ocamlformat index b07e8c36879..8c7a8d21729 100644 --- a/infer/src/.ocamlformat +++ b/infer/src/.ocamlformat @@ -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 diff --git a/infer/src/IR/Exp.ml b/infer/src/IR/Exp.ml index 528589b6647..2710e08d036 100644 --- a/infer/src/IR/Exp.ml +++ b/infer/src/IR/Exp.ml @@ -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] diff --git a/infer/src/IR/Exp.mli b/infer/src/IR/Exp.mli index 0ee82c7c91c..7d27b8f893e 100644 --- a/infer/src/IR/Exp.mli +++ b/infer/src/IR/Exp.mli @@ -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] diff --git a/infer/src/IR/Fieldname.mli b/infer/src/IR/Fieldname.mli index 70c06ac4251..9f3f965f18d 100644 --- a/infer/src/IR/Fieldname.mli +++ b/infer/src/IR/Fieldname.mli @@ -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 diff --git a/infer/src/IR/Instrs.ml b/infer/src/IR/Instrs.ml index 0c31354fe4f..34aeebc97ac 100644 --- a/infer/src/IR/Instrs.ml +++ b/infer/src/IR/Instrs.ml @@ -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 diff --git a/infer/src/IR/Instrs.mli b/infer/src/IR/Instrs.mli index 143ef1fbb9a..fd66f6e4cf5 100644 --- a/infer/src/IR/Instrs.mli +++ b/infer/src/IR/Instrs.mli @@ -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 diff --git a/infer/src/IR/ProcAttributes.mli b/infer/src/IR/ProcAttributes.mli index 85ae178537f..85b563bf32d 100644 --- a/infer/src/IR/ProcAttributes.mli +++ b/infer/src/IR/ProcAttributes.mli @@ -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 = diff --git a/infer/src/IR/Procdesc.mli b/infer/src/IR/Procdesc.mli index 6d8fc72172b..1a52e1f7416 100644 --- a/infer/src/IR/Procdesc.mli +++ b/infer/src/IR/Procdesc.mli @@ -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 @@ -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 diff --git a/infer/src/IR/PythonClassName.mli b/infer/src/IR/PythonClassName.mli index ecf82a246e9..f78d04f175e 100644 --- a/infer/src/IR/PythonClassName.mli +++ b/infer/src/IR/PythonClassName.mli @@ -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") *) diff --git a/infer/src/IR/Specialization.mli b/infer/src/IR/Specialization.mli index 1c58f014169..40dfac4c8c7 100644 --- a/infer/src/IR/Specialization.mli +++ b/infer/src/IR/Specialization.mli @@ -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] diff --git a/infer/src/IR/Tenv.mli b/infer/src/IR/Tenv.mli index dfc74b02289..a7177f6a238 100644 --- a/infer/src/IR/Tenv.mli +++ b/infer/src/IR/Tenv.mli @@ -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 diff --git a/infer/src/IR/Typ.mli b/infer/src/IR/Typ.mli index 729a61b4810..1d2d90e0642 100644 --- a/infer/src/IR/Typ.mli +++ b/infer/src/IR/Typ.mli @@ -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 diff --git a/infer/src/absint/AbstractInterpreter.ml b/infer/src/absint/AbstractInterpreter.ml index 6f993c018a9..96d5eeb15c5 100644 --- a/infer/src/absint/AbstractInterpreter.ml +++ b/infer/src/absint/AbstractInterpreter.ml @@ -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 @@ -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 ( @@ -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] *) diff --git a/infer/src/absint/AccessPath.mli b/infer/src/absint/AccessPath.mli index 4699b3c5455..b401ba62cf0 100644 --- a/infer/src/absint/AccessPath.mli +++ b/infer/src/absint/AccessPath.mli @@ -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 diff --git a/infer/src/absint/ExplicitTrace.mli b/infer/src/absint/ExplicitTrace.mli index c77e75131af..cdcd3c05e6b 100644 --- a/infer/src/absint/ExplicitTrace.mli +++ b/infer/src/absint/ExplicitTrace.mli @@ -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 diff --git a/infer/src/absint/HilExp.mli b/infer/src/absint/HilExp.mli index 8caf536c711..156431e96f1 100644 --- a/infer/src/absint/HilExp.mli +++ b/infer/src/absint/HilExp.mli @@ -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"] diff --git a/infer/src/absint/MethodMatcher.mli b/infer/src/absint/MethodMatcher.mli index acbfc3d6764..2afea973bf1 100644 --- a/infer/src/absint/MethodMatcher.mli +++ b/infer/src/absint/MethodMatcher.mli @@ -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 diff --git a/infer/src/backend/CallbackOfChecker.ml b/infer/src/backend/CallbackOfChecker.ml index 05600ceeef2..f1163afc8f1 100644 --- a/infer/src/backend/CallbackOfChecker.ml +++ b/infer/src/backend/CallbackOfChecker.ml @@ -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 diff --git a/infer/src/backend/Payloads.ml b/infer/src/backend/Payloads.ml index 49151412704..fb1c331da47 100644 --- a/infer/src/backend/Payloads.ml +++ b/infer/src/backend/Payloads.ml @@ -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 diff --git a/infer/src/backend/StarvationGlobalAnalysis.ml b/infer/src/backend/StarvationGlobalAnalysis.ml index 28cfe8c9f45..2d1e442b24a 100644 --- a/infer/src/backend/StarvationGlobalAnalysis.ml +++ b/infer/src/backend/StarvationGlobalAnalysis.ml @@ -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 diff --git a/infer/src/backend/ondemand.ml b/infer/src/backend/ondemand.ml index 064913a8d86..ba492258de0 100644 --- a/infer/src/backend/ondemand.ml +++ b/infer/src/backend/ondemand.ml @@ -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) ) ; () @@ -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 \ diff --git a/infer/src/base/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml index d5bec5c2b05..4560c8570c5 100644 --- a/infer/src/base/CommandLineOption.ml +++ b/infer/src/base/CommandLineOption.ml @@ -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 | [] | "--" :: _ -> diff --git a/infer/src/base/CommandLineOption.mli b/infer/src/base/CommandLineOption.mli index a69eb46fd88..3ecc315900f 100644 --- a/infer/src/base/CommandLineOption.mli +++ b/infer/src/base/CommandLineOption.mli @@ -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. @@ -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. *) @@ -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. *) diff --git a/infer/src/base/DBWriter.ml b/infer/src/base/DBWriter.ml index 747bd57157e..a859ef417ce 100644 --- a/infer/src/base/DBWriter.ml +++ b/infer/src/base/DBWriter.ml @@ -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 diff --git a/infer/src/base/Logging.mli b/infer/src/base/Logging.mli index 9381b6dbd75..f8e97a38434 100644 --- a/infer/src/base/Logging.mli +++ b/infer/src/base/Logging.mli @@ -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__ *) diff --git a/infer/src/base/MarkupFormatter.mli b/infer/src/base/MarkupFormatter.mli index 1a22d8dcca5..14b55760154 100644 --- a/infer/src/base/MarkupFormatter.mli +++ b/infer/src/base/MarkupFormatter.mli @@ -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 *) diff --git a/infer/src/base/PerfEvent.mli b/infer/src/base/PerfEvent.mli index f1da15bbe1a..8d835bbcd93 100644 --- a/infer/src/base/PerfEvent.mli +++ b/infer/src/base/PerfEvent.mli @@ -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 diff --git a/infer/src/base/Serialization.mli b/infer/src/base/Serialization.mli index 7fb926894db..03cefe10007 100644 --- a/infer/src/base/Serialization.mli +++ b/infer/src/base/Serialization.mli @@ -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 *) diff --git a/infer/src/base/Utils.mli b/infer/src/base/Utils.mli index 81a9155d3d4..7d33fa13839 100644 --- a/infer/src/base/Utils.mli +++ b/infer/src/base/Utils.mli @@ -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 diff --git a/infer/src/biabduction/Attribute.ml b/infer/src/biabduction/Attribute.ml index cc922d3ea97..e198b21e210 100644 --- a/infer/src/biabduction/Attribute.ml +++ b/infer/src/biabduction/Attribute.ml @@ -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 diff --git a/infer/src/biabduction/DotBiabduction.ml b/infer/src/biabduction/DotBiabduction.ml index 9d162583227..a23310c9b72 100644 --- a/infer/src/biabduction/DotBiabduction.ml +++ b/infer/src/biabduction/DotBiabduction.ml @@ -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 diff --git a/infer/src/biabduction/Match.ml b/infer/src/biabduction/Match.ml index b12febce499..f1e89b67eaf 100644 --- a/infer/src/biabduction/Match.ml +++ b/infer/src/biabduction/Match.ml @@ -18,7 +18,7 @@ let mem_idlist i l = List.exists ~f:(Ident.equal i) l considered, and flag = true means that it is considered during pattern matching *) type hpred_pat = {hpred: Predicates.hpred; flag: bool} -(** Checks [e1 = e2\[sub ++ sub'\]] for some [sub'] with [dom(sub') subseteq vars]. Returns +(** Checks [e1 = e2[sub ++ sub']] for some [sub'] with [dom(sub') subseteq vars]. Returns [(sub ++ sub', vars - dom(sub'))]. *) let rec exp_match e1 sub vars e2 : (Predicates.subst * Ident.t list) option = let check_equal sub vars e1 e2 = @@ -94,7 +94,7 @@ let exp_list_match es1 sub vars es2 = None -(** Checks [sexp1 = sexp2\[sub ++ sub'\]] for some [sub'] with [dom(sub') subseteq vars]. Returns +(** Checks [sexp1 = sexp2[sub ++ sub']] for some [sub'] with [dom(sub') subseteq vars]. Returns [(sub ++ sub', vars - dom(sub'))]. WARNING: This function does not consider the fact that the analyzer sometimes forgets fields of hpred. It can possibly cause a problem. *) let rec strexp_match (sexp1 : Predicates.strexp) sub vars (sexp2 : Predicates.strexp) : @@ -116,7 +116,7 @@ let rec strexp_match (sexp1 : Predicates.strexp) sub vars (sexp2 : Predicates.st None ) -(** Checks [fsel1 = fsel2\[sub ++ sub'\]] for some [sub'] with [dom(sub') subseteq vars]. Returns +(** Checks [fsel1 = fsel2[sub ++ sub']] for some [sub'] with [dom(sub') subseteq vars]. Returns [(sub ++ sub', vars - dom(sub'))]. *) and fsel_match fsel1 sub vars fsel2 = match (fsel1, fsel2) with @@ -140,7 +140,7 @@ and fsel_match fsel1 sub vars fsel2 = else None -(** Checks [isel1 = isel2\[sub ++ sub'\]] for some [sub'] with [dom(sub') subseteq vars]. Returns +(** Checks [isel1 = isel2[sub ++ sub']] for some [sub'] with [dom(sub') subseteq vars]. Returns [(sub ++ sub', vars - dom(sub'))]. *) and isel_match isel1 sub vars isel2 = match (isel1, isel2) with @@ -543,8 +543,8 @@ and hpara_dll_match_with_impl tenv impl_ok (para1 : Predicates.hpara_dll) (** [prop_match_with_impl p condition vars hpat hpats] returns [(subst, p_leftover)] such that + [dom(subst) = vars] - + [p |- (hpat.hpred * hpats.hpred)\[subst\] * p_leftover]. Using the flag [field], we can - control the strength of |-. *) + + [p |- (hpat.hpred * hpats.hpred)[subst] * p_leftover]. Using the flag [field], we can control + the strength of |-. *) let prop_match_with_impl tenv p condition vars hpat hpats = prop_match_with_impl_sub tenv p condition Predicates.sub_empty vars hpat hpats diff --git a/infer/src/biabduction/Match.mli b/infer/src/biabduction/Match.mli index dc853aaa8cf..7578de4b34d 100644 --- a/infer/src/biabduction/Match.mli +++ b/infer/src/biabduction/Match.mli @@ -39,7 +39,7 @@ val prop_match_with_impl : (** [prop_match_with_impl p condition vars hpat hpats] returns [(subst, p_leftover)] such that + [dom(subst) = vars] - + [p |- (hpat.hpred * hpats.hpred)\[subst\] * p_leftover]. + + [p |- (hpat.hpred * hpats.hpred)[subst] * p_leftover]. Using the flag [field], we can control the strength of |-. *) diff --git a/infer/src/biabduction/Predicates.ml b/infer/src/biabduction/Predicates.ml index 62370fc65f8..2fec29bbbc4 100644 --- a/infer/src/biabduction/Predicates.ml +++ b/infer/src/biabduction/Predicates.ml @@ -66,9 +66,9 @@ type 'inst strexp0 = | Earray of Exp.t * (Exp.t * 'inst strexp0) list * 'inst (** Array of given length There are two conditions imposed / used in the array case. First, if some index and value pair appears inside an array in a strexp, then the index is less than - the length of the array. For instance, [x |->\[10 | e1: v1\]] implies that [e1 <= 9]. + the length of the array. For instance, [x |->[10 | e1: v1]] implies that [e1 <= 9]. Second, if two indices appear in an array, they should be different. For instance, - [x |->\[10 | e1: v1, e2: v2\]] implies that [e1 != e2]. *) + [x |->[10 | e1: v1, e2: v2]] implies that [e1 != e2]. *) [@@deriving compare] type strexp = inst strexp0 @@ -1149,7 +1149,7 @@ let sigma_to_sigma_ne sigma : (atom list * hpred list) list = (** [hpara_instantiate para e1 e2 elist] instantiates [para] with [e1], [e2] and [elist]. If [para = lambda (x, y, xs). exists zs. b], then the result of the instantiation is - [b\[e1 / x, e2 / y, elist / xs, zs'_/ zs\]] for some fresh [_zs'].*) + [b[e1 / x, e2 / y, elist / xs, zs'_/ zs]] for some fresh [_zs'].*) let hpara_instantiate para e1 e2 elist = let subst_for_svars = let g id e = (id, e) in @@ -1171,7 +1171,7 @@ let hpara_instantiate para e1 e2 elist = (** [hpara_dll_instantiate para cell blink flink elist] instantiates [para] with [cell], [blink], [flink], and [elist]. If [para = lambda (x, y, z, xs). exists zs. b], then the result of the - instantiation is [b\[cell / x, blink / y, flink / z, elist / xs, zs'_/ zs\]] for some fresh + instantiation is [b[cell / x, blink / y, flink / z, elist / xs, zs'_/ zs]] for some fresh [_zs'].*) let hpara_dll_instantiate (para : hpara_dll) cell blink flink elist = let subst_for_svars = diff --git a/infer/src/biabduction/Predicates.mli b/infer/src/biabduction/Predicates.mli index b2f5b3d9ad2..e9c0fca1e74 100644 --- a/infer/src/biabduction/Predicates.mli +++ b/infer/src/biabduction/Predicates.mli @@ -100,9 +100,9 @@ type 'inst strexp0 = | Earray of Exp.t * (Exp.t * 'inst strexp0) list * 'inst (** Array of given length There are two conditions imposed / used in the array case. First, if some index and value pair appears inside an array in a strexp, then the index is less than - the length of the array. For instance, [x |->\[10 | e1: v1\]] implies that [e1 <= 9]. + the length of the array. For instance, [x |->[10 | e1: v1]] implies that [e1 <= 9]. Second, if two indices appear in an array, they should be different. For instance, - [x |->\[10 | e1: v1, e2: v2\]] implies that [e1 != e2]. *) + [x |->[10 | e1: v1, e2: v2]] implies that [e1 != e2]. *) [@@deriving compare] type strexp = inst strexp0 @@ -365,13 +365,13 @@ val sigma_to_sigma_ne : hpred list -> (atom list * hpred list) list val hpara_instantiate : hpara -> Exp.t -> Exp.t -> Exp.t list -> Ident.t list * hpred list (** [hpara_instantiate para e1 e2 elist] instantiates [para] with [e1], [e2] and [elist]. If [para = lambda (x, y, xs). exists zs. b], then the result of the instantiation is - [b\[e1 / x, e2 / y, elist / xs, _zs'/ zs\]] for some fresh [_zs'].*) + [b[e1 / x, e2 / y, elist / xs, _zs'/ zs]] for some fresh [_zs'].*) val hpara_dll_instantiate : hpara_dll -> Exp.t -> Exp.t -> Exp.t -> Exp.t list -> Ident.t list * hpred list (** [hpara_dll_instantiate para cell blink flink elist] instantiates [para] with [cell], [blink], [flink], and [elist]. If [para = lambda (x, y, z, xs). exists zs. b], then the result of the - instantiation is [b\[cell / x, blink / y, flink / z, elist / xs, _zs'/ zs\]] for some fresh + instantiation is [b[cell / x, blink / y, flink / z, elist / xs, _zs'/ zs]] for some fresh [_zs'].*) val custom_error : Pvar.t diff --git a/infer/src/biabduction/Prop.ml b/infer/src/biabduction/Prop.ml index 615c22a65a3..9221a3c0613 100644 --- a/infer/src/biabduction/Prop.ml +++ b/infer/src/biabduction/Prop.ml @@ -542,9 +542,8 @@ let sigma_get_unsigned_exps sigma = !uexps -(** Collapse consecutive indices that should be added. For instance, this function reduces - [x\[1\]\[1\]] to [x\[2\]]. The [typ] argument is used to ensure the soundness of this - collapsing. *) +(** Collapse consecutive indices that should be added. For instance, this function reduces [x[1][1]] + to [x[2]]. The [typ] argument is used to ensure the soundness of this collapsing. *) let exp_collapse_consecutive_indices_prop (typ : Typ.t) exp = let typ_is_base (typ1 : Typ.t) = match typ1.desc with Tint _ | Tfloat _ | Tstruct _ | Tvoid | Tfun -> true | _ -> false diff --git a/infer/src/biabduction/Prop.mli b/infer/src/biabduction/Prop.mli index 3d201a9a62d..820b9fbbd25 100644 --- a/infer/src/biabduction/Prop.mli +++ b/infer/src/biabduction/Prop.mli @@ -141,9 +141,8 @@ val exp_normalize_noabs : Tenv.t -> subst -> Exp.t -> Exp.t (** Normalize the expression without abstracting complex subexpressions *) val exp_collapse_consecutive_indices_prop : Typ.t -> Exp.t -> Exp.t -(** Collapse consecutive indices that should be added. For instance, this function reduces - [x\[1\]\[1\]] to [x\[2\]]. The [typ] argument is used to ensure the soundness of this - collapsing. *) +(** Collapse consecutive indices that should be added. For instance, this function reduces [x[1][1]] + to [x[2]]. The [typ] argument is used to ensure the soundness of this collapsing. *) val lexp_normalize_prop : Tenv.t -> 'a t -> Exp.t -> Exp.t (** Normalize [exp] used for the address of a heap cell. This normalization does not combine two diff --git a/infer/src/biabduction/Prover.ml b/infer/src/biabduction/Prover.ml index a4671e69fc1..c302d995a56 100644 --- a/infer/src/biabduction/Prover.ml +++ b/infer/src/biabduction/Prover.ml @@ -1324,8 +1324,8 @@ let extend_sub sub v e = Predicates.sub_join new_exp_sub (Predicates.sub_range_map (Predicates.exp_sub new_exp_sub) sub) -(** Extend [sub1] and [sub2] to witnesses that each instance of [e1\[sub1\]] is an instance of - [e2\[sub2\]]. Raise IMPL_FALSE if not possible. *) +(** Extend [sub1] and [sub2] to witnesses that each instance of [e1[sub1]] is an instance of + [e2[sub2]]. Raise IMPL_FALSE if not possible. *) let exp_imply tenv calc_missing (subs : subst2) e1_in e2_in : subst2 = let e1 = Prop.exp_normalize_noabs tenv (fst subs) e1_in in let e2 = Prop.exp_normalize_noabs tenv (snd subs) e2_in in @@ -1491,8 +1491,8 @@ let array_len_imply tenv calc_missing subs len1 len2 indices2 = subs -(** Extend [sub1] and [sub2] to witnesses that each instance of [se1\[sub1\]] is an instance of - [se2\[sub2\]]. Raise IMPL_FALSE if not possible. *) +(** Extend [sub1] and [sub2] to witnesses that each instance of [se1[sub1]] is an instance of + [se2[sub2]]. Raise IMPL_FALSE if not possible. *) let rec sexp_imply tenv source calc_index_frame calc_missing subs se1 se2 typ2 : subst2 * Predicates.strexp option * Predicates.strexp option = (* L.d_str "sexp_imply "; Predicates.d_sexp se1; L.d_str " "; Predicates.d_sexp se2; diff --git a/infer/src/biabduction/Rearrange.ml b/infer/src/biabduction/Rearrange.ml index 7ee2f9f1fca..c7c8396d10c 100644 --- a/infer/src/biabduction/Rearrange.ml +++ b/infer/src/biabduction/Rearrange.ml @@ -164,8 +164,8 @@ let rec create_struct_values analysis_data pname tenv orig_prop footprint_part k (* In this case, we lift t to the t array. *) let t', mk_typ_f = match t.Typ.desc with - | Typ.Tptr (t', _) -> ( - (t', function desc -> Typ.mk ~default:t desc) ) + | Typ.Tptr (t', _) -> + (t', function desc -> Typ.mk ~default:t desc) | _ -> (t, fun desc -> Typ.mk desc) in diff --git a/infer/src/biabduction/RetainCycles.ml b/infer/src/biabduction/RetainCycles.ml index bb2efc349e3..451a77ad73b 100644 --- a/infer/src/biabduction/RetainCycles.ml +++ b/infer/src/biabduction/RetainCycles.ml @@ -124,8 +124,7 @@ let get_cycle_blocks root_node exp = | Typ.Tptr (_, Typ.Pk_objc_weak) | Typ.Tptr (_, Typ.Pk_objc_unsafe_unretained) -> None | _ -> - if Exp.equal e root_node.RetainCyclesType.rc_node_exp then Some (name, var) else None - ) + if Exp.equal e root_node.RetainCyclesType.rc_node_exp then Some (name, var) else None ) captured_vars | _ -> None diff --git a/infer/src/biabduction/SymExec.ml b/infer/src/biabduction/SymExec.ml index e87a12f2a5e..da5ae29b468 100644 --- a/infer/src/biabduction/SymExec.ml +++ b/infer/src/biabduction/SymExec.ml @@ -1072,7 +1072,7 @@ let declare_locals_and_ret tenv pdesc (prop_ : Prop.normal Prop.t) = (** Execute [instr] with a symbolic heap [prop].*) let rec sym_exec ( {InterproceduralAnalysis.proc_desc= current_pdesc; analyze_dependency; err_log; tenv} as - analysis_data ) instr_ (prop_ : Prop.normal Prop.t) path : + analysis_data ) instr_ (prop_ : Prop.normal Prop.t) path : (Prop.normal Prop.t * Paths.Path.t) list = AnalysisState.set_instr instr_ ; (* mark instruction last seen *) diff --git a/infer/src/biabduction/Tabulation.ml b/infer/src/biabduction/Tabulation.ml index 4a045763d58..f04b6b41fbd 100644 --- a/infer/src/biabduction/Tabulation.ml +++ b/infer/src/biabduction/Tabulation.ml @@ -767,14 +767,12 @@ let combine ({InterproceduralAnalysis.proc_desc= caller_pdesc; tenv; _} as analy else List.map ~f:(fun (p, path_post) -> - (p, Paths.Path.add_call (include_subtrace callee_pname) path_pre callee_pname path_post) - ) + (p, Paths.Path.add_call (include_subtrace callee_pname) path_pre callee_pname path_post) ) posts in List.map ~f:(fun (p, path) -> - post_process_post analysis_data callee_pname loc actual_pre (Prop.prop_sub split.sub p, path) - ) + post_process_post analysis_data callee_pname loc actual_pre (Prop.prop_sub split.sub p, path) ) posts' in L.d_increase_indent () ; diff --git a/infer/src/bufferoverrun/bufferOverrunAnalysis.ml b/infer/src/bufferoverrun/bufferOverrunAnalysis.ml index cc80f316a0b..10115988b81 100644 --- a/infer/src/bufferoverrun/bufferOverrunAnalysis.ml +++ b/infer/src/bufferoverrun/bufferOverrunAnalysis.ml @@ -377,7 +377,7 @@ module TransferFunctions = struct | Load {id; e= Exp.Lvar pvar; typ; loc= location} when Pvar.is_compile_constant pvar || Pvar.is_ice pvar -> load_global_constant get_summary (id, typ) pvar location mem - ~find_from_initializer:(fun callee_mem -> Dom.Mem.find (Loc.of_pvar pvar) callee_mem) + ~find_from_initializer:(fun callee_mem -> Dom.Mem.find (Loc.of_pvar pvar) callee_mem ) | Load {id; e= Exp.Lindex (Exp.Lvar pvar, _); typ; loc= location} when Pvar.is_compile_constant pvar || Pvar.is_ice pvar || (Pvar.is_constant_array pvar && Pvar.is_const pvar) -> diff --git a/infer/src/bufferoverrun/bufferOverrunDomain.mli b/infer/src/bufferoverrun/bufferOverrunDomain.mli index f38eefc90d1..c83335a027b 100644 --- a/infer/src/bufferoverrun/bufferOverrunDomain.mli +++ b/infer/src/bufferoverrun/bufferOverrunDomain.mli @@ -104,7 +104,7 @@ module Val : sig particular assignment (this affects the field traces - see Val.add_assign_trace_elem). *) val is_mone : t -> bool - (** Check if the value is [\[-1,-1\]] *) + (** Check if the value is [[-1,-1]] *) val array_sizeof : t -> Itv.t (** Get array size *) @@ -118,8 +118,8 @@ module Val : sig val get_array_blk : t -> ArrayBlk.t val get_range_of_iterator : t -> t - (** Get a range of an iterator value, for example, if iterator value is [\[lb,ub\]], it returns - [\[0,ub\]]. *) + (** Get a range of an iterator value, for example, if iterator value is [[lb,ub]], it returns + [[0,ub]]. *) val get_itv : t -> Itv.t @@ -279,28 +279,28 @@ module Val : sig module Itv : sig val nat : t - (** [\[0,+oo\]] *) + (** [[0,+oo]] *) val pos : t - (** [\[1,+oo\]] *) + (** [[1,+oo]] *) val top : t - (** [\[-oo,+oo\]] *) + (** [[-oo,+oo]] *) val zero : t - (** [\[0,0\]] *) + (** [[0,0]] *) val one : t - (** [\[1,1\]] *) + (** [[1,1]] *) val zero_255 : t - (** [\[0,255\]] *) + (** [[0,255]] *) val m1_255 : t - (** [\[-1,255\]] *) + (** [[-1,255]] *) val unknown_bool : t - (** [\[0,1\]] *) + (** [[0,1]] *) end end diff --git a/infer/src/bufferoverrun/bufferOverrunSemantics.mli b/infer/src/bufferoverrun/bufferOverrunSemantics.mli index 26efeec7041..835903d50b3 100644 --- a/infer/src/bufferoverrun/bufferOverrunSemantics.mli +++ b/infer/src/bufferoverrun/bufferOverrunSemantics.mli @@ -42,7 +42,7 @@ val conservative_array_length : (** Evaluate the array length conservatively, which is useful when there are multiple array locations and their lengths are joined to top. For example, if the [arr_locs] points to two arrays [a] and [b] and if their lengths are [a.length] and [b.length], this function evaluates - its length as [\[0, a.length.ub + b.length.ub\]]. *) + its length as [[0, a.length.ub + b.length.ub]]. *) (** Several modes of ondemand evaluations *) type eval_mode = diff --git a/infer/src/checkers/Lineage.ml b/infer/src/checkers/Lineage.ml index 97e60dd2294..987b5a3cbd3 100644 --- a/infer/src/checkers/Lineage.ml +++ b/infer/src/checkers/Lineage.ml @@ -669,7 +669,7 @@ module Tito : sig (** TITO stands for "taint-in taint-out". In this context a tito flow is a data path from an argument field to a field of the return node, without going through call edges; more precisely, [i#foo#bar] is a tito path to [ret#baz] if there is a path from - [Argument (i, \[foo, bar\])] to [Return baz] not going through [ArgumentOf _] nodes. + [Argument (i, [foo, bar])] to [Return baz] not going through [ArgumentOf _] nodes. As the abstraction mandates, fields are to be considered in a prefix sense: a path from [i#foo] to [ret#bar] means that any subfield of [i#foo] flows into all fields of [ret#bar]. @@ -694,8 +694,7 @@ module Tito : sig val full : arity:int -> t (** A full tito has paths from every argument field to every return field. Due to the prefix - abstraction, it is equivalent to having a path from every [Argument (i, \[\])] to - [Return \[\]].*) + abstraction, it is equivalent to having a path from every [Argument (i, [])] to [Return []].*) val add : arg_index:int diff --git a/infer/src/checkers/LineageShape.ml b/infer/src/checkers/LineageShape.ml index ab5bdaeb702..f62f8d70125 100644 --- a/infer/src/checkers/LineageShape.ml +++ b/infer/src/checkers/LineageShape.ml @@ -417,8 +417,8 @@ end = struct be the same shape as [X]. Within [main], the shape of the argument of [f] is actually known to be the - singleton variant [\[ok\]]. That argument is not introduced as an abstract shape - by the call instruction, which allows actually unifying it with a variant at + singleton variant [[ok]]. That argument is not introduced as an abstract shape by + the call instruction, which allows actually unifying it with a variant at call-time. [Y] will still have the same shape as that argument as mandated by the summary of [f], therefore [Y] will correctly be inferred as the variant [ok]. *) | Vector of @@ -856,8 +856,7 @@ end = struct also be affected in the process. If it doesn't we don't need to create it. *) List.iter ~f:(fun constructor -> - unify_field state map_shape ~field_label:(FieldLabel.map_key constructor) ~value_shape - ) + unify_field state map_shape ~field_label:(FieldLabel.map_key constructor) ~value_shape ) constructors | None -> (* Key isn't variant-shaped: we potentially unify every map value field in the map. *) diff --git a/infer/src/checkers/LineageShape.mli b/infer/src/checkers/LineageShape.mli index f363ca59b57..4510ec27e83 100644 --- a/infer/src/checkers/LineageShape.mli +++ b/infer/src/checkers/LineageShape.mli @@ -20,7 +20,7 @@ end module FieldPath : sig (** A module to help manipulating lists of (nested) fields. *) - (** The fields are listed in syntactic order: [\[a; b\]] for [x#a#b]. *) + (** The fields are listed in syntactic order: [[a; b]] for [x#a#b]. *) type t = FieldLabel.t list [@@deriving compare, equal, sexp, hash, yojson_of] include Comparable.S with type t := t diff --git a/infer/src/checkers/LithoDomain.ml b/infer/src/checkers/LithoDomain.ml index b7c8a4ec52c..63c18f9a9c7 100644 --- a/infer/src/checkers/LithoDomain.ml +++ b/infer/src/checkers/LithoDomain.ml @@ -133,7 +133,7 @@ module Created = struct SubstPathMap.find_opt path map |> Option.value_map ~default:acc ~f:(fun caller_path -> Option.value_map (find_opt caller_path caller) ~default:acc - ~f:(fun caller_created -> append caller_return caller_created acc) ) + ~f:(fun caller_created -> append caller_return caller_created acc ) ) in CreatedLocations.fold accum_subst callee_returns acc ) diff --git a/infer/src/clang/CMockPointerSubst.ml b/infer/src/clang/CMockPointerSubst.ml index 8e222233917..5048b954d0b 100644 --- a/infer/src/clang/CMockPointerSubst.ml +++ b/infer/src/clang/CMockPointerSubst.ml @@ -65,7 +65,7 @@ let replace_mockpointers_calls globals_map _procname proc_desc = in ignore (Procdesc.replace_instrs_by_using_context proc_desc ~f:add_calls - ~update_context:(update_context globals_map) ~context_at_node:(fun _ -> Ident.Map.empty) ) + ~update_context:(update_context globals_map) ~context_at_node:(fun _ -> Ident.Map.empty ) ) let process cfg prefix = diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index b3cc4884b8d..76990775dc7 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -2262,8 +2262,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s in List.iter ~f:(fun n -> - Procdesc.node_set_succs context.procdesc n ~normal:res_trans_s2.control.root_nodes ~exn:[] - ) + Procdesc.node_set_succs context.procdesc n ~normal:res_trans_s2.control.root_nodes ~exn:[] ) prune_to_s2 ; let root_nodes_to_parent = if List.is_empty res_trans_s1.control.root_nodes then res_trans_s1.control.leaf_nodes @@ -3123,8 +3122,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s | _ -> None ) ~mk_second:(fun trans_state stmt_info -> - init_expr_trans_aux ~is_structured_binding trans_state var_exp_typ stmt_info init_expr - ) + init_expr_trans_aux ~is_structured_binding trans_state var_exp_typ stmt_info init_expr ) ~mk_return:(fun ~fst:_ ~snd -> snd.return) @@ -3561,7 +3559,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s objCArrayDictLiteral_trans trans_state expr_info stmt_info stmts method_pointer - (** Translates an array literal [NSArray* a = @\[ @2, @3 \];] to + (** Translates an array literal [NSArray* a = @[ @2, @3 ];] to {[ n$1=NSNumber.numberWithInt:(2:int) @@ -3670,7 +3668,7 @@ module CTrans_funct (F : CModule_type.CFrontend) : CModule_type.CTranslation = s objCArrayDictLiteral_trans trans_state expr_info stmt_info stmts method_pointer - (** Translates an dictionary literal [@\[ @"firstName": @"Foo", @"lastName":@"Bar" \]] to + (** Translates an dictionary literal [@[ @"firstName": @"Foo", @"lastName":@"Bar" ]] to {[ n$1=NSString.stringWithUTF8:(@"firstName") diff --git a/infer/src/clang/cTrans_utils.mli b/infer/src/clang/cTrans_utils.mli index bf302ec6d49..056259ecf84 100644 --- a/infer/src/clang/cTrans_utils.mli +++ b/infer/src/clang/cTrans_utils.mli @@ -304,4 +304,4 @@ val last_or_mk_fresh_void_exp_typ : (Exp.t * Typ.t) list -> Exp.t * Typ.t val should_remove_first_param : trans_state -> Clang_ast_t.stmt -> Typ.name option (** Return a class name when the first parameter should be removed according to its context, for - example, when [self] or [\[x class\]] is given as the first parameter for a class method. *) + example, when [self] or [[x class]] is given as the first parameter for a class method. *) diff --git a/infer/src/cost/cost.ml b/infer/src/cost/cost.ml index 2eac2a82868..e3c04fadff9 100644 --- a/infer/src/cost/cost.ml +++ b/infer/src/cost/cost.ml @@ -281,16 +281,16 @@ module Check = struct if not (is_report_suppressed pname) then CostIssues.CostKindMap.iter2 CostIssues.enabled_cost_map cost ~f:(fun - _kind - CostIssues. - { name - ; unreachable_issue - ; infinite_issue - ; expensive_issue - ; top_and_unreachable - ; expensive } - cost - -> + _kind + CostIssues. + { name + ; unreachable_issue + ; infinite_issue + ; expensive_issue + ; top_and_unreachable + ; expensive } + cost + -> let report = mk_report proc_desc pname err_log (Procdesc.get_loc proc_desc) ~name cost in if top_and_unreachable then report_top_and_unreachable ~report ~unreachable_issue ~infinite_issue cost ; diff --git a/infer/src/integration/BuckFlavors.ml b/infer/src/integration/BuckFlavors.ml index c49d02ba285..b2b42172d4e 100644 --- a/infer/src/integration/BuckFlavors.ml +++ b/infer/src/integration/BuckFlavors.ml @@ -34,7 +34,7 @@ let run_buck_build prog buck_build_args = L.debug Capture Verbose "%s %s@." prog (List.to_string ~f:Fn.id buck_build_args) ; let infer_args = Option.fold (Sys.getenv CommandLineOption.args_env_var) ~init:"--fcp-syntax-only" - ~f:(fun acc arg -> Printf.sprintf "%s%c%s" acc CommandLineOption.env_var_sep arg) + ~f:(fun acc arg -> Printf.sprintf "%s%c%s" acc CommandLineOption.env_var_sep arg ) in let extend_env = [(CommandLineOption.args_env_var, infer_args)] in Buck.wrap_buck_call ~extend_env ~label:"build" V1 (prog :: buck_build_args) |> ignore diff --git a/infer/src/integration/Gradle.ml b/infer/src/integration/Gradle.ml index dae94c683e4..2bd47ee1d66 100644 --- a/infer/src/integration/Gradle.ml +++ b/infer/src/integration/Gradle.ml @@ -101,7 +101,7 @@ let capture_gradle_target (out_dir, (javac_data : javac_data)) = let run_infer_capture target_data = Tasks.Runner.create ~jobs:Config.jobs ~child_prologue:ignore ~f:capture_gradle_target - ~child_epilogue:ignore (fun () -> ProcessPool.TaskGenerator.of_list target_data) + ~child_epilogue:ignore (fun () -> ProcessPool.TaskGenerator.of_list target_data ) |> Tasks.Runner.run |> ignore diff --git a/infer/src/integration/Hack.mli b/infer/src/integration/Hack.mli index 2695e5f07d2..be6500a6619 100644 --- a/infer/src/integration/Hack.mli +++ b/infer/src/integration/Hack.mli @@ -10,7 +10,7 @@ open! IStd val capture : prog:string -> args:string list -> unit val location_of_class_db : Sqlite3.db -> class_name:string -> Sqlite3.Rc.t * string list - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] val location_of_class : naming_table:string -> class_name:string -> Sqlite3.Rc.t * string list - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] diff --git a/infer/src/integration/Help.ml b/infer/src/integration/Help.ml index 7b13b02e7f6..bef8a1548ff 100644 --- a/infer/src/integration/Help.ml +++ b/infer/src/integration/Help.ml @@ -148,16 +148,16 @@ let list_issue_types () = IssueType.all_issues () |> List.iter ~f:(fun - ({ IssueType.unique_id - ; checker - ; visibility - ; user_documentation= - _ - (* do not show this as this can be a big multi-line string and not tool-friendly *) - ; default_severity - ; enabled - ; hum } [@warning "+missing-record-field-pattern"] ) - -> + ({ IssueType.unique_id + ; checker + ; visibility + ; user_documentation= + _ + (* do not show this as this can be a big multi-line string and not tool-friendly *) + ; default_severity + ; enabled + ; hum } [@warning "+missing-record-field-pattern"] ) + -> L.result "%s:%s:%s:%s:%b:%s@;" unique_id hum (IssueType.string_of_visibility visibility) (IssueType.string_of_severity default_severity) diff --git a/infer/src/integration/JsonReports.mli b/infer/src/integration/JsonReports.mli index 6031817060b..e003ff0895e 100644 --- a/infer/src/integration/JsonReports.mli +++ b/infer/src/integration/JsonReports.mli @@ -22,6 +22,6 @@ val compute_hash : -> file:string -> qualifier:string -> string - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] val write_reports : issues_json:string -> costs_json:string -> config_impact_json:string -> unit diff --git a/infer/src/integration/XcodeBuild.ml b/infer/src/integration/XcodeBuild.ml index 608b4881404..b834913c303 100644 --- a/infer/src/integration/XcodeBuild.ml +++ b/infer/src/integration/XcodeBuild.ml @@ -29,7 +29,7 @@ let capture ~prog ~args = let infer_args = Option.fold (Sys.getenv CommandLineOption.args_env_var) ~init:(Printf.sprintf "%s%c%s" "--fcp-apple-clang" CommandLineOption.env_var_sep apple_clang) - ~f:(fun acc arg -> Printf.sprintf "%s%c%s" acc CommandLineOption.env_var_sep arg) + ~f:(fun acc arg -> Printf.sprintf "%s%c%s" acc CommandLineOption.env_var_sep arg ) in L.debug Capture Verbose "%s [%s] [%s]@." prog (String.concat ~sep:"," args) infer_args ; let {Unix.Process_info.stdin; stdout; stderr; pid} = diff --git a/infer/src/istd/IFmt.mli b/infer/src/istd/IFmt.mli index 2696861eea1..174e5bb61d9 100644 --- a/infer/src/istd/IFmt.mli +++ b/infer/src/istd/IFmt.mli @@ -15,7 +15,7 @@ module Labelled : sig (** Adapters of [Fmt] functions using labelled interfaces *) val iter : ?sep:unit Fmt.t -> ('a -> f:('elt -> unit) -> unit) -> 'elt Fmt.t -> 'a Fmt.t - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] (** [Fmt.iter] using a Core-style labelled iterator function *) val iter_bindings : diff --git a/infer/src/istd/Pp.mli b/infer/src/istd/Pp.mli index d05bd177cb1..00aaec93f01 100644 --- a/infer/src/istd/Pp.mli +++ b/infer/src/istd/Pp.mli @@ -109,7 +109,7 @@ val pair : -> unit val in_backticks : (F.formatter -> 'a -> unit) -> F.formatter -> 'a -> unit - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] val collection : fold:('t, 'item, bool) Container.fold diff --git a/infer/src/java/jTransType.ml b/infer/src/java/jTransType.ml index 5981fc00a7b..999557fe05d 100644 --- a/infer/src/java/jTransType.ml +++ b/infer/src/java/jTransType.ml @@ -368,8 +368,7 @@ let get_var_type_from_sig (context : JContext.t) var = let tenv = JContext.get_tenv context in List.find_map ~f:(fun (vt', var') -> - if JBir.var_equal var var' then Some (param_type program tenv context.cn var' vt') else None - ) + if JBir.var_equal var var' then Some (param_type program tenv context.cn var' vt') else None ) (JBir.params context.impl) diff --git a/infer/src/pulse/Pulse.ml b/infer/src/pulse/Pulse.ml index 6430012aa7d..aa60dda9dac 100644 --- a/infer/src/pulse/Pulse.ml +++ b/infer/src/pulse/Pulse.ml @@ -260,7 +260,8 @@ module PulseTransferFunctions = struct let topl_event = PulseTopl.ArrayWrite {aw_array; aw_index} in AbductiveDomain.Topl.small_step loc topl_event astate ) |> PulseOperationResult.sat_ok - |> (* don't emit Topl event if evals fail *) Option.value ~default:astate + |> (* don't emit Topl event if evals fail *) + Option.value ~default:astate | _ -> astate diff --git a/infer/src/pulse/PulseAbductiveDomain.ml b/infer/src/pulse/PulseAbductiveDomain.ml index 09707d12f47..da846da9028 100644 --- a/infer/src/pulse/PulseAbductiveDomain.ml +++ b/infer/src/pulse/PulseAbductiveDomain.ml @@ -163,11 +163,11 @@ module Internal = struct let downcast_fst pair = (pair : CanonValue.t * _ :> AbstractValue.t * _) [@@inline always] let downcast_snd_fst pair_pair = (pair_pair : _ * (CanonValue.t * _) :> _ * (AbstractValue.t * _)) - [@@inline always] + [@@inline always] let downcast_access access = (access : BaseMemory.Access.t :> RawMemory.Access.t) - [@@inline always] + [@@inline always] module SafeBaseMemory = struct @@ -1333,14 +1333,14 @@ module Internal = struct let reachable_addresses ?(var_filter = fun _ -> true) ?edge_filter astate pre_or_post = GraphVisit.fold astate pre_or_post ~var_filter ?edge_filter ~init:() ~finish:Fn.id - ~f:(fun _ () _ _ -> Continue ()) + ~f:(fun _ () _ _ -> Continue () ) |> fst let reachable_addresses_from ?(already_visited = CanonValue.Set.empty) ?edge_filter addresses astate pre_or_post = GraphVisit.fold_from_addresses ?edge_filter addresses astate pre_or_post ~init:() - ~already_visited ~finish:Fn.id ~f:(fun () _ _ -> Continue ()) + ~already_visited ~finish:Fn.id ~f:(fun () _ _ -> Continue () ) |> fst end @@ -1417,7 +1417,7 @@ let mk_initial tenv (proc_attrs : ProcAttributes.t) = let formals_and_captured = captured @ formals in let initial_stack = List.fold formals_and_captured ~init:(PreDomain.empty :> BaseDomain.t).stack - ~f:(fun stack (formal, _, _, addr_loc) -> BaseStack.add formal addr_loc stack) + ~f:(fun stack (formal, _, _, addr_loc) -> BaseStack.add formal addr_loc stack ) in let initial_heap = let register heap (_, _, _, (addr, _)) = @@ -1440,8 +1440,8 @@ let mk_initial tenv (proc_attrs : ProcAttributes.t) = in let post = List.fold proc_attrs.locals ~init:post - ~f:(fun (acc : PostDomain.t) {ProcAttributes.name; typ; modify_in_block; is_constexpr; tmp_id} - -> + ~f:(fun + (acc : PostDomain.t) {ProcAttributes.name; typ; modify_in_block; is_constexpr; tmp_id} -> if modify_in_block || is_constexpr || Option.is_some tmp_id then acc else SafeAttributes.set_uninitialized_post tenv Timestamp.t0 diff --git a/infer/src/pulse/PulseCanonValue.mli b/infer/src/pulse/PulseCanonValue.mli index 1749bd33e69..8cd8924160e 100644 --- a/infer/src/pulse/PulseCanonValue.mli +++ b/infer/src/pulse/PulseCanonValue.mli @@ -24,10 +24,10 @@ module type S = sig val downcast_set : Set.t -> AbstractValue.Set.t [@@inline always] val unsafe_cast_set : AbstractValue.Set.t -> Set.t - [@@deprecated - "unsafe, obviously; please add a comment why you need to use this and suppress this warning \ - locally with [@alert \"-deprecated\"]"] - [@@inline always] + [@@deprecated + "unsafe, obviously; please add a comment why you need to use this and suppress this warning \ + locally with [@alert \"-deprecated\"]"] + [@@inline always] (** an abstract value that needs to be normalized; just [AbstractValue.t] under the hood too *) type needs_canon @@ -72,10 +72,10 @@ module type S = sig representative if the value is not immediately made equal to another one... Use with caution! *) val unsafe_cast : AbstractValue.t -> t - [@@deprecated - "unsafe, obviously; please add a comment why you need to use this and suppress this warning \ - locally with [@alert \"-deprecated\"]"] - [@@inline always] + [@@deprecated + "unsafe, obviously; please add a comment why you need to use this and suppress this warning \ + locally with [@alert \"-deprecated\"]"] + [@@inline always] (** {2 Domain elements, revisited to be safe wrt value normalization} *) diff --git a/infer/src/pulse/PulseContext.ml b/infer/src/pulse/PulseContext.ml index 0c8eb281df6..b750768859b 100644 --- a/infer/src/pulse/PulseContext.ml +++ b/infer/src/pulse/PulseContext.ml @@ -13,7 +13,7 @@ let tenv_ref = ref (None : Tenv.t Option.t) let () = AnalysisGlobalState.register_ref_with_proc_desc_and_tenv proc_desc_ref - ~init:(fun proc_desc _tenv -> Some proc_desc) + ~init:(fun proc_desc _tenv -> Some proc_desc ) let () = diff --git a/infer/src/pulse/PulseFormula.ml b/infer/src/pulse/PulseFormula.ml index 4e479d395b9..a15e03bd97f 100644 --- a/infer/src/pulse/PulseFormula.ml +++ b/infer/src/pulse/PulseFormula.ml @@ -474,7 +474,7 @@ module Tableau = struct let gain = Q.(-(q_c / coeff)) in if Container.for_all ~iter:(Container.iter ~fold:LinArith.fold) l - ~f:(fun (_, coeff') -> Q.(coeff' >= zero || -(q_c / coeff') >= gain)) + ~f:(fun (_, coeff') -> Q.(coeff' >= zero || -(q_c / coeff') >= gain) ) then Some (u, (v, coeff)) else None else None ) ) @@ -1559,10 +1559,10 @@ module Atom = struct let nnot_if b atom = if b then nnot atom else atom - (** [atoms_of_term ~negated t] is [Some \[atom1; ..; atomN\]] if [t] (or [¬t] if [negated]) is + (** [atoms_of_term ~negated t] is [Some [atom1; ..; atomN]] if [t] (or [¬t] if [negated]) is (mostly syntactically) equivalent to [atom1 ∧ .. ∧ atomN]. For example [atoms_of_term ~negated:false (Equal (Or (x, Not y), 0))] should be - [\[Equal (x, 0); NotEqual (y, 0)\]]. When the term [y] is known as a boolean, it generates a + [[Equal (x, 0); NotEqual (y, 0)]]. When the term [y] is known as a boolean, it generates a preciser atom [Equal (y, 1)]. [is_neq_zero] is a function that can tell if a term is known to be [≠0], and [force_to_atom] @@ -2046,8 +2046,8 @@ module Formula = struct INVARIANT: see {!Tableau} *) ; intervals: (intervals[@yojson.opaque]) - (** A simple, non-relational domain of concrete integer intervals of the form - [x∈\[i,j\]] or [x∉\[i,j\]]. + (** A simple, non-relational domain of concrete integer intervals of the form [x∈[i,j]] + or [x∉[i,j]]. This is used to recover a little bit of completeness on integer reasoning at no great cost. *) diff --git a/infer/src/pulse/PulseFormula.mli b/infer/src/pulse/PulseFormula.mli index 2081b71e88b..dc88c6d2919 100644 --- a/infer/src/pulse/PulseFormula.mli +++ b/infer/src/pulse/PulseFormula.mli @@ -27,7 +27,7 @@ type t [@@deriving compare, equal, yojson_of] val pp : F.formatter -> t -> unit val pp_with_pp_var : (F.formatter -> Var.t -> unit) -> F.formatter -> t -> unit - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** only used for unit tests *) type function_symbol = Unknown of Var.t | Procname of Procname.t [@@deriving compare, equal] diff --git a/infer/src/pulse/PulseInterproc.ml b/infer/src/pulse/PulseInterproc.ml index 95e1d5cae5d..1e96125b958 100644 --- a/infer/src/pulse/PulseInterproc.ml +++ b/infer/src/pulse/PulseInterproc.ml @@ -159,8 +159,8 @@ module Unsafe : sig a broken (partial) summary application. *) ; aliases: HeapPath.Set.t HeapPath.Map.t (** if an alias was detected between a [addr_callee] and [addr_callee'] with heap path - accesses [path] nad [path'], then [aliases\[addr_callee\]] contains [addr_callee'], - where [rev_subst\[addr_caller\] = (addr_callee, path)]. *) } + accesses [path] nad [path'], then [aliases[addr_callee]] contains [addr_callee'], + where [rev_subst[addr_caller] = (addr_callee, path)]. *) } val to_caller_value_ : AbductiveDomain.t diff --git a/infer/src/pulse/PulseModelsDSL.mli b/infer/src/pulse/PulseModelsDSL.mli index 98559e96dc4..5f5137b4eec 100644 --- a/infer/src/pulse/PulseModelsDSL.mli +++ b/infer/src/pulse/PulseModelsDSL.mli @@ -43,7 +43,7 @@ module Syntax : sig -> init:'accum -> f:('accum -> AbstractValue.t -> 'accum model_monad) -> 'accum model_monad - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] val absvalue_set_iter : AbstractValue.Set.t -> f:(AbstractValue.t -> unit model_monad) -> unit model_monad diff --git a/infer/src/pulse/PulseModelsErlang.ml b/infer/src/pulse/PulseModelsErlang.ml index 9d7f842a373..f367e07a79e 100644 --- a/infer/src/pulse/PulseModelsErlang.ml +++ b/infer/src/pulse/PulseModelsErlang.ml @@ -83,12 +83,12 @@ let eval_into_fresh eval = example, consider [f] of type ['a->('b,'err) result list] and [g] of type ['b->('c,'err) result list] and [a] is some value of type ['a]. Note that the type of error is the same, so they can be propagated forward. To chain the application of these functions, you - can write [let> x=f a in let> y=g x in \[Ok y\]]. + can write [let> x=f a in let> y=g x in [Ok y]]. In several places, we have to compose with functions of the type ['a->('b,'err) result], which don't produce a list. One way to handle this is to wrap those functions in a list. For example, if [f] and [a] have the same type as before but [g] has type ['b->('c,'err) result], then we can - write [let> =f a in let> y=\[g x\] in \[Ok y\].] *) + write [let> =f a in let> y=[g x] in [Ok y].] *) let ( let> ) x f = List.concat_map ~f:(function diff --git a/infer/src/pulse/PulseModelsErlang.mli b/infer/src/pulse/PulseModelsErlang.mli index 039e5d36629..faa463b6e88 100644 --- a/infer/src/pulse/PulseModelsErlang.mli +++ b/infer/src/pulse/PulseModelsErlang.mli @@ -18,10 +18,10 @@ val get_model_from_db : -> model_no_non_disj option val get_module_attribute : Tenv.t -> tag:string -> string option - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] val get_erlang_type_or_any : AbstractValue.t -> AbductiveDomain.t -> ErlangTypeName.t - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] include sig [@@@warning "-unused-module"] @@ -37,7 +37,7 @@ include sig | GenServer of {module_name: string option} val return_value_model : erlang_value -> model_no_non_disj - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] val exists_db_model : Procname.t -> bool end diff --git a/infer/src/pulse/PulseModelsSmartPointers.ml b/infer/src/pulse/PulseModelsSmartPointers.ml index b0177e6a96d..b23d49a913b 100644 --- a/infer/src/pulse/PulseModelsSmartPointers.ml +++ b/infer/src/pulse/PulseModelsSmartPointers.ml @@ -437,9 +437,9 @@ module SharedPtr = struct let<*> astate, args_without_this = PulseResult.list_fold (List.rev args_without_this) ~init:(astate, []) ~f:(fun - (astate, rev_func_args) - (ProcnameDispatcher.Call.FuncArg.{exp; typ; arg_payload= value} as arg) - -> + (astate, rev_func_args) + (ProcnameDispatcher.Call.FuncArg.{exp; typ; arg_payload= value} as arg) + -> let+ astate, new_payload = PulseOperations.eval_access path Read location value Dereference astate in diff --git a/infer/src/pulse/PulseNonDisjunctiveOperations.ml b/infer/src/pulse/PulseNonDisjunctiveOperations.ml index 6fdeaa236d5..8c1c7364ebb 100644 --- a/infer/src/pulse/PulseNonDisjunctiveOperations.ml +++ b/infer/src/pulse/PulseNonDisjunctiveOperations.ml @@ -601,7 +601,7 @@ let is_modified_since_detected addr ~is_param ~get_repr ~current_heap astate ~co || let addr_to_explore = UnsafeMemory.Edges.fold edges_curr ~init:addr_to_explore - ~f:(fun acc (_, (addr, _)) -> addr :: acc) + ~f:(fun acc (_, (addr, _)) -> addr :: acc ) in aux ~addr_to_explore ~visited ) in diff --git a/infer/src/pulse/PulseOperations.mli b/infer/src/pulse/PulseOperations.mli index 017b9e3b7cc..d4514f1be50 100644 --- a/infer/src/pulse/PulseOperations.mli +++ b/infer/src/pulse/PulseOperations.mli @@ -186,7 +186,7 @@ val write_arr_index : -> obj:AbstractValue.t * ValueHistory.t -> t -> t AccessResult.t -(** write the edge [ref\[index\]--> obj] *) +(** write the edge [ref[index]--> obj] *) val write_deref : PathContext.t diff --git a/infer/src/pulse/PulseTaintConfig.ml b/infer/src/pulse/PulseTaintConfig.ml index d30eb373899..ee78e542f18 100644 --- a/infer/src/pulse/PulseTaintConfig.ml +++ b/infer/src/pulse/PulseTaintConfig.ml @@ -647,12 +647,12 @@ let fill_policies_from_config () = Config.pulse_taint_config.policies |> List.iter ~f:(fun - { Pulse_config_t.short_description= description - ; taint_flows - ; privacy_effect - ; exclude_in - ; exclude_matching } - -> + { Pulse_config_t.short_description= description + ; taint_flows + ; privacy_effect + ; exclude_in + ; exclude_matching } + -> let policy_id = SinkPolicy.next_policy_id () in let exclude_matching = Option.map exclude_matching ~f:(fun regexes -> diff --git a/infer/src/pulse/PulseTaintItemMatcher.ml b/infer/src/pulse/PulseTaintItemMatcher.ml index 43e8b5c3dfe..193f5137390 100644 --- a/infer/src/pulse/PulseTaintItemMatcher.ml +++ b/infer/src/pulse/PulseTaintItemMatcher.ml @@ -190,7 +190,7 @@ let procedure_matches tenv matchers ?block_passed_to ?proc_attributes proc_name (fun class_name _ -> Option.exists (Tenv.lookup tenv class_name) ~f:(fun procedure_superclass_type -> Annotations.struct_typ_has_annot procedure_superclass_type - (fun annot_item -> Annotations.ia_ends_with annot_item annotation) + (fun annot_item -> Annotations.ia_ends_with annot_item annotation ) && PatternMatch.override_exists ~check_current_type:false (fun superclass_pname -> String.equal (Procname.get_method superclass_pname) method_name ) diff --git a/infer/src/pulse/PulseTrace.mli b/infer/src/pulse/PulseTrace.mli index cc39c90498d..d7dd8032442 100644 --- a/infer/src/pulse/PulseTrace.mli +++ b/infer/src/pulse/PulseTrace.mli @@ -57,7 +57,7 @@ val synchronous_add_to_errlog : -> t list -> Errlog.loc_trace_elem list -> Errlog.loc_trace_elem list - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** [synchronous_add_to_errlog] adds a list of the traces to the errlog in the given order while grouping traces that take place at the same location to reduce deduplication and ensure events happening together are identifiable as such. E.g. if two traces start with a [ViaCall] and they diff --git a/infer/src/pulse/PulseValueHistory.mli b/infer/src/pulse/PulseValueHistory.mli index 6a1807dfcd6..452fd45aae9 100644 --- a/infer/src/pulse/PulseValueHistory.mli +++ b/infer/src/pulse/PulseValueHistory.mli @@ -49,9 +49,9 @@ type event = and t = private | Epoch (** start of time *) | Sequence of event * t - (** [Sequence \[event, hist\]] represents an event [event] occurring *after* [hist]. - Invariant: the timestamp of [event] is greater than all the (local, i.e. not inside - function calls) timestamps in [hist]. *) + (** [Sequence [event, hist]] represents an event [event] occurring *after* [hist]. Invariant: + the timestamp of [event] is greater than all the (local, i.e. not inside function calls) + timestamps in [hist]. *) | InContext of { main: t (** trace of the "main" value being traced *) ; context: t list (** contextual traces, eg conditionals that the path is under *) } @@ -111,7 +111,7 @@ val rev_iter_main : t -> f:(iter_event -> unit) -> unit timestamp of the event following the inner [Call] event in the example above. *) val iter : main_only:bool -> t -> f:(iter_event -> unit) -> unit - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** like [rev_iter_main] but iterates in order (by reversing the order iteration) and iterates on only main events like [rev_iter_main] if [main_only] is [true], otherwise iterates on *all* events including contexts if [main_only] is [false] *) diff --git a/infer/src/python/FFI.mli b/infer/src/python/FFI.mli index e7adda97ce4..d493a24cd70 100644 --- a/infer/src/python/FFI.mli +++ b/infer/src/python/FFI.mli @@ -37,7 +37,7 @@ module rec Constant : sig [@@deriving compare] val show : ?full:bool -> t -> string - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] (** Only shows the name of a [PYCCode] constant if [full] is [false]. Otherwise, shows everything. *) val pp : Format.formatter -> t -> unit @@ -101,7 +101,7 @@ and Instruction : sig end val from_string : source:string -> filename:string -> (Code.t, Error.t) result - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** Compiles the python program describes by [source] into a [Code.t] object *) val from_file : is_binary:bool -> string -> (Code.t, Error.t) result diff --git a/infer/src/python/PyCommon.mli b/infer/src/python/PyCommon.mli index cc772f08fdf..ff2dbba48f3 100644 --- a/infer/src/python/PyCommon.mli +++ b/infer/src/python/PyCommon.mli @@ -183,7 +183,7 @@ end type annotated_name = {name: string; annotation: Ident.t} val pp_annotated_name : Format.formatter -> annotated_name -> unit - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] type signature = annotated_name list @@ -227,7 +227,7 @@ val entry : string (** Textual label name for entry points of function we synthesized (constructors, __init__, ...) *) val self : string - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** Common name of the [self] argument in Python *) (** Flags used by MAKE_FUNCTION *) diff --git a/infer/src/python/PyEnv.mli b/infer/src/python/PyEnv.mli index d589ebce9b2..ff626f3faa7 100644 --- a/infer/src/python/PyEnv.mli +++ b/infer/src/python/PyEnv.mli @@ -271,7 +271,7 @@ val is_toplevel : t -> bool (** Are we processing top level instructions, or something in a function/class ? *) val is_static : t -> bool - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] (** Are we processing instructions from a static method ? *) val get_params : t -> string list diff --git a/infer/src/python/PyIR.ml b/infer/src/python/PyIR.ml index 9042f2386ed..a61cbf1bacd 100644 --- a/infer/src/python/PyIR.ml +++ b/infer/src/python/PyIR.ml @@ -290,7 +290,7 @@ module Exp = struct "map" | String -> "string" - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] type import_name = {id: Ident.t; fromlist: string list} @@ -381,7 +381,7 @@ module Exp = struct "Packed" | Yield _ -> "Yield" - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] let rec pp fmt = function @@ -723,7 +723,7 @@ module Jump = struct F.fprintf fmt "TwoWay(%a, %a, %a)" Exp.pp condition pp_info next_info pp_info other_info | Throw exp -> F.fprintf fmt "Throw(%a)" Exp.pp exp - [@@warning "-unused-value-declaration"] + [@@warning "-unused-value-declaration"] end module Terminator = struct diff --git a/infer/src/python/PyTrans.ml b/infer/src/python/PyTrans.ml index 8ecaf49075b..3d7eda9ea31 100644 --- a/infer/src/python/PyTrans.ml +++ b/infer/src/python/PyTrans.ml @@ -594,22 +594,22 @@ module LOAD = struct | ATTR (** {v LOAD_ATTR(namei) v} - Replaces top-of-stack with [getattr(top-of-stack, co_names\[namei\])]. *) + Replaces top-of-stack with [getattr(top-of-stack, co_names[namei])]. *) | CONST (** {v LOAD_CONST(consti) v} - Pushes [co_consts\[consti\]] onto the stack. *) + Pushes [co_consts[consti]] onto the stack. *) | FAST (** {v LOAD_FAST(var_num) v} - Pushes a reference to the local [co_varnames\[var_num\]] onto the stack. *) + Pushes a reference to the local [co_varnames[var_num]] onto the stack. *) | GLOBAL (** {v LOAD_GLOBAL(namei) v} - Loads the global named [co_names\[namei\]] onto the stack. *) + Loads the global named [co_names[namei]] onto the stack. *) | NAME (** {v LOAD_NAME(namei) v} - Pushes the value associated with [co_names\[namei\]] onto the stack. *) + Pushes the value associated with [co_names[namei]] onto the stack. *) let run kind env ({FFI.Code.co_names; co_varnames; co_consts} as code) {FFI.Instruction.opname; arg} = @@ -1268,11 +1268,11 @@ module METHOD = struct (** {v LOAD_METHOD(namei) v} - Loads a method named [co_names\[namei\]] from the top-of-stack object. top-of-stack is - popped. This bytecode distinguishes two cases: if top-of-stack has a method with the correct - name, the bytecode pushes the unbound method and top-of-stack. top-of-stack will be used as - the first argument ([self]) by [CALL_METHOD] when calling the unbound method. Otherwise, - [NULL] and the object return by the attribute lookup are pushed. *) + Loads a method named [co_names[namei]] from the top-of-stack object. top-of-stack is popped. + This bytecode distinguishes two cases: if top-of-stack has a method with the correct name, + the bytecode pushes the unbound method and top-of-stack. top-of-stack will be used as the + first argument ([self]) by [CALL_METHOD] when calling the unbound method. Otherwise, [NULL] + and the object return by the attribute lookup are pushed. *) let run env {FFI.Code.co_names} {FFI.Instruction.opname; arg} = let open IResult.Let_syntax in let method_name = co_names.(arg) in @@ -1364,7 +1364,7 @@ module STORE = struct | FAST (** {v STORE_FAST(var_num) v} - Stores top-of-stack into the local [co_varnames\[var_num\]]. *) + Stores top-of-stack into the local [co_varnames[var_num]]. *) | NAME (** {v STORE_NAME(namei) v} @@ -1479,7 +1479,7 @@ module STORE = struct module SUBSCR = struct (** {v STORE_SUBSCR v} - Implements [top-of-stack1\[top-of-stack\] = top-of-stack2] *) + Implements [top-of-stack1[top-of-stack] = top-of-stack2] *) let run env {FFI.Instruction.opname} = let open IResult.Let_syntax in Debug.p "[%s]\n" opname ; @@ -1566,7 +1566,7 @@ module BINARY = struct module SUBSCR = struct (** {v BINARY_SUBSCR v} - Implements [top-of-stack = top-of-stack1\[top-of-stack\]]. *) + Implements [top-of-stack = top-of-stack1[top-of-stack]]. *) let run env {FFI.Instruction.opname} = let open IResult.Let_syntax in Debug.p "[%s]\n" opname ; @@ -2008,10 +2008,10 @@ module IMPORT = struct module NAME = struct (** {v IMPORT_NAME(namei) v} - Imports the module [co_names\[namei\]]. The two top elements from the the stack are popped - and provide the [fromlist] and [level] arguments of [__import__()]. The module object is - pushed onto the stack. The current namespace is not affected: for a proper import statement, - a subsequent STORE_FAST instruction modifies the namespace. + Imports the module [co_names[namei]]. The two top elements from the the stack are popped and + provide the [fromlist] and [level] arguments of [__import__()]. The module object is pushed + onto the stack. The current namespace is not affected: for a proper import statement, a + subsequent STORE_FAST instruction modifies the namespace. Also the doc says: [level] specifies whether to use absolute or relative imports. 0 (the default) means only perform absolute imports. Positive values for [level] indicate the @@ -2094,7 +2094,7 @@ module IMPORT = struct module FROM = struct (** {v IMPORT_FROM(namei) v} - Loads the attribute [co_names\[namei\]] from the module found in the top of the stack. The + Loads the attribute [co_names[namei]] from the module found in the top of the stack. The resulting object is pushed onto the stack, to be subsequently stored by a [STORE_FAST] instruction. *) let run env {FFI.Code.co_names} {FFI.Instruction.opname; arg} = @@ -2123,7 +2123,7 @@ end module COMPARE_OP = struct (** {v COMPARE_OP(opname) v} - Performs a Boolean operation. The operation name can be found in [cmp_op\[opname\]]. + Performs a Boolean operation. The operation name can be found in [cmp_op[opname]]. [ dis.cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is', 'is not', 'exception match', 'BAD') ] *) let run env {FFI.Instruction.opname; arg} = @@ -3136,9 +3136,9 @@ let rec class_declaration env module_name ({FFI.Code.instructions; co_name} as c let register_methods env codes method_infos opname = List.fold_result method_infos ~init:(env, codes) ~f:(fun - (env, codes) - {PyClassDecl.State.code; signature; defaults; flags; is_static; is_abstract} - -> + (env, codes) + {PyClassDecl.State.code; signature; defaults; flags; is_static; is_abstract} + -> let* env, default_arguments = load_defaults env defaults in let* () = check_flags opname flags in let env = diff --git a/infer/src/textual/Textual.mli b/infer/src/textual/Textual.mli index e35554be71f..8fcec7befc6 100644 --- a/infer/src/textual/Textual.mli +++ b/infer/src/textual/Textual.mli @@ -277,7 +277,7 @@ module Exp : sig | Load of {exp: t; typ: Typ.t option} | Lvar of VarName.t (** the address of a program variable *) | Field of {exp: t; field: qualified_fieldname} (** field offset *) - | Index of t * t (** an array index offset: [exp1\[exp2\]] *) + | Index of t * t (** an array index offset: [exp1[exp2]] *) | Const of Const.t | Call of {proc: QualifiedProcName.t; args: t list; kind: call_kind} | Closure of {proc: QualifiedProcName.t; captured: t list; params: VarName.t list} diff --git a/infer/src/textual/TextualParser.mli b/infer/src/textual/TextualParser.mli index 29629c35d66..cb069beff80 100644 --- a/infer/src/textual/TextualParser.mli +++ b/infer/src/textual/TextualParser.mli @@ -20,7 +20,7 @@ val pp_error : Textual.SourceFile.t -> F.formatter -> error -> unit val error_to_string : Textual.SourceFile.t -> error -> string val parse_string : Textual.SourceFile.t -> string -> (Textual.Module.t, error list) result - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] module TextualFile : sig type t = diff --git a/infer/src/textual/TextualSil.mli b/infer/src/textual/TextualSil.mli index c8393472f94..8a366ff2a59 100644 --- a/infer/src/textual/TextualSil.mli +++ b/infer/src/textual/TextualSil.mli @@ -8,7 +8,7 @@ open! IStd val proc_decl_to_sil : Textual.Lang.t -> Textual.ProcDecl.t -> Procname.t - [@@warning "-unused-value-declaration"] +[@@warning "-unused-value-declaration"] val module_to_sil : Textual.Module.t -> Cfg.t * Tenv.t diff --git a/infer/src/unit/analyzerTester.ml b/infer/src/unit/analyzerTester.ml index 3ee961f1479..ba891387882 100644 --- a/infer/src/unit/analyzerTester.ml +++ b/infer/src/unit/analyzerTester.ml @@ -347,8 +347,7 @@ struct List.concat_map ~f:(fun (name, test_program) -> List.map ai_list ~f:(fun (ai_name, create_test) -> - name ^ "_" ^ ai_name >:: create_test test_program make_analysis_data ~initial pp_opt ) - ) + name ^ "_" ^ ai_name >:: create_test test_program make_analysis_data ~initial pp_opt ) ) tests end diff --git a/opam/ocamlformat.opam.locked b/opam/ocamlformat.opam.locked index 371849df989..a6989cff348 100644 --- a/opam/ocamlformat.opam.locked +++ b/opam/ocamlformat.opam.locked @@ -1,9 +1,14 @@ opam-version: "2.0" name: "ocamlformat" -version: "0.25.1" +version: "0.26.1" synopsis: "Auto-formatter for OCaml code" -description: - "OCamlFormat is a tool to automatically format OCaml code in a uniform style." +description: """\ +**ocamlformat** is a code formatter for OCaml. It comes with opinionated default settings but is also fully customizable to suit your coding style. + +- **Profiles:** ocamlformat offers profiles we predefined formatting configurations. Profiles include `default`, `ocamlformat`, `janestreet`. +- **Configurable:** Users can change the formatting profile and configure every option in their `.ocamlformat` configuration file. +- **Format Comments:** ocamlformat can format comments, docstrings, and even code blocks in your comments. +- **RPC:** ocamlformat provides an RPC server that can be used by other tools to easily format OCaml Code.""" license: ["MIT" "LGPL-2.1-only WITH OCaml-LGPL-linking-exception"] homepage: "https://github.com/ocaml-ppx/ocamlformat" bug-reports: "https://github.com/ocaml-ppx/ocamlformat/issues" @@ -34,7 +39,7 @@ depends: [ "ocaml-version" {= "3.6.4"} "ocamlbuild" {= "0.14.3"} "ocamlfind" {= "1.9.6"} - "ocamlformat-lib" {= "0.25.1"} + "ocamlformat-lib" {= "0.26.1"} "ocp-indent" {= "1.8.1"} "re" {= "1.11.0"} "result" {= "1.5"} @@ -63,12 +68,10 @@ build: [ dev-repo: "git+https://github.com/ocaml-ppx/ocamlformat.git" url { src: - "https://github.com/ocaml-ppx/ocamlformat/releases/download/0.25.1/ocamlformat-0.25.1.tbz" + "https://github.com/ocaml-ppx/ocamlformat/releases/download/0.26.1/ocamlformat-0.26.1.tbz" checksum: [ - "sha256=dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d" - "sha512=b28f545425fb5375447c90022d065dc7fd51ed2f66d8c1f65a71a6ad2465d039a8686e8f18249e5ad3a2362fee6149c855ef30eb45fb9d06d743a53d26b3e26f" + "sha256=da006e427f15b9ec612fb808d446599bd9b7c3ee25abeb3d555747a70d74c6d7" + "sha512=b7413f8dc47ba3a2372e89d59cae54f9a602ab81e31cd14ed986a831111080b79a5a3cc45dac04d8ffae5054c35bf29fe9559f145c76c87a30e191ed5400942a" ] } -x-commit-hash: "651f767b48e14ba6b24db9421306942d9e51adcc" -maintainer: "OCamlFormat Team " -authors: "Josh Berdine " \ No newline at end of file +x-commit-hash: "651f767b48e14ba6b24db9421306942d9e51adcc" \ No newline at end of file