[infer] make the censor reason an option field in the analysis report

Reviewed By: mbouaziz

Differential Revision: D15077671

fbshipit-source-id: 5a22429f9
master
Jeremy Dubreil 6 years ago committed by Facebook Github Bot
parent 711e7d1611
commit 5b76bb876f

@ -44,7 +44,7 @@ type jsonbug = {
bug_type_hum: string; bug_type_hum: string;
?linters_def_file: string option; ?linters_def_file: string option;
?traceview_id: int option; ?traceview_id: int option;
censored_reason : string; ?censored_reason : string option;
?access : string option; ?access : string option;
?extras : extra option; ?extras : extra option;
} }

@ -193,7 +193,7 @@ let censored_reason (issue_type : IssueType.t) source_file =
in in
Option.some_if (not accepted) reason Option.some_if (not accepted) reason
in in
Option.value ~default:"" (List.find_map Config.filter_report ~f:rejected_by) List.find_map Config.filter_report ~f:rejected_by
let potential_exception_message = "potential exception at line" let potential_exception_message = "potential exception at line"
@ -449,7 +449,7 @@ module IssuesTxt = struct
in in
if if
error_filter source_file key.err_name error_filter source_file key.err_name
&& ((not Config.filtering) || String.is_empty (censored_reason key.err_name source_file)) && ((not Config.filtering) || Option.is_none (censored_reason key.err_name source_file))
then Exceptions.pp_err err_data.loc key.severity key.err_name key.err_desc None fmt () then Exceptions.pp_err err_data.loc key.severity key.err_name key.err_desc None fmt ()

@ -10,6 +10,6 @@ open! IStd
val loc_trace_to_jsonbug_record : val loc_trace_to_jsonbug_record :
Errlog.loc_trace_elem list -> Exceptions.severity -> Jsonbug_t.json_trace_item list Errlog.loc_trace_elem list -> Exceptions.severity -> Jsonbug_t.json_trace_item list
val censored_reason : IssueType.t -> SourceFile.t -> string val censored_reason : IssueType.t -> SourceFile.t -> string option
val main : report_json:string option -> unit val main : report_json:string option -> unit

@ -31,7 +31,7 @@ let create_fake_jsonbug ?(bug_type = "bug_type") ?(qualifier = "qualifier")
; linters_def_file ; linters_def_file
; doc_url ; doc_url
; traceview_id= None ; traceview_id= None
; censored_reason= "" ; censored_reason= None
; access= None ; access= None
; extras= None } ; extras= None }

Loading…
Cancel
Save