[infer] make the visibility field optional

Reviewed By: mbouaziz

Differential Revision: D13643462

fbshipit-source-id: b13f08698
master
Jeremy Dubreil 6 years ago committed by Facebook Github Bot
parent 339911bb75
commit 148c269b0d

@ -30,7 +30,7 @@ type jsonbug = {
?doc_url : string option; ?doc_url : string option;
qualifier : string; qualifier : string;
severity : string; severity : string;
visibility : string; ?visibility : string option;
line: int; line: int;
column: int; column: int;
procedure : string; procedure : string;

@ -177,7 +177,7 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
{ Jsonbug_j.bug_type= issue_type.IssueType.unique_id { Jsonbug_j.bug_type= issue_type.IssueType.unique_id
; qualifier ; qualifier
; severity= Exceptions.severity_string severity ; severity= Exceptions.severity_string severity
; visibility= Exceptions.string_of_visibility Exceptions.Exn_user ; visibility= Some (Exceptions.string_of_visibility Exceptions.Exn_user)
; line ; line
; column ; column
; procedure= cost_info.Jsonbug_t.procedure_id ; procedure= cost_info.Jsonbug_t.procedure_id

@ -283,7 +283,7 @@ module JsonIssuePrinter = MakeJsonListPrinter (struct
| _ -> | _ ->
None None
in in
let visibility = Exceptions.string_of_visibility err_data.visibility in let visibility = Some (Exceptions.string_of_visibility err_data.visibility) in
let qualifier = let qualifier =
let base_qualifier = error_desc_to_plain_string err_key.err_desc in let base_qualifier = error_desc_to_plain_string err_key.err_desc in
if IssueType.(equal resource_leak) err_key.err_name then if IssueType.(equal resource_leak) err_key.err_name then
@ -398,7 +398,7 @@ let pp_custom_of_report fmt report fields =
| `Issue_field_severity -> | `Issue_field_severity ->
Format.fprintf fmt "%s%s" (comma_separator index) issue.severity Format.fprintf fmt "%s%s" (comma_separator index) issue.severity
| `Issue_field_visibility -> | `Issue_field_visibility ->
Format.fprintf fmt "%s%s" (comma_separator index) issue.visibility Format.fprintf fmt "%s%a" (comma_separator index) (Pp.option String.pp) issue.visibility
| `Issue_field_line -> | `Issue_field_line ->
Format.fprintf fmt "%s%d" (comma_separator index) issue.line Format.fprintf fmt "%s%d" (comma_separator index) issue.line
| `Issue_field_column -> | `Issue_field_column ->

@ -8,7 +8,7 @@
open! IStd open! IStd
let create_fake_jsonbug ?(bug_type = "bug_type") ?(qualifier = "qualifier") let create_fake_jsonbug ?(bug_type = "bug_type") ?(qualifier = "qualifier")
?(severity = "severity") ?(visibility = "visibility") ?(line = 1) ?(column = 1) ?(severity = "severity") ?(visibility = None) ?(line = 1) ?(column = 1)
?(procedure = "procedure") ?(procedure_start_line = 1) ?(file = "file/at/a/certain/path.java") ?(procedure = "procedure") ?(procedure_start_line = 1) ?(file = "file/at/a/certain/path.java")
?(bug_trace = []) ?(key = "File|method|TYPE") ?(node_key = Some "1234") ?(hash = "1") ?(bug_trace = []) ?(key = "File|method|TYPE") ?(node_key = Some "1234") ?(hash = "1")
?(dotty = None) ?(infer_source_loc = None) ?(linters_def_file = Some "file/at/certain/path.al") ?(dotty = None) ?(infer_source_loc = None) ?(linters_def_file = Some "file/at/certain/path.al")

Loading…
Cancel
Save