From 40ead0ac3d70750393cfbe08e7309371aecf92d2 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 29 Jan 2019 12:54:49 -0800 Subject: [PATCH] [infer] remove the visibility field from the Infer JSON report Reviewed By: mbouaziz Differential Revision: D9689136 fbshipit-source-id: fabdb3ffc --- infer/man/man1/infer-full.txt | 2 +- infer/man/man1/infer-report.txt | 2 +- infer/man/man1/infer.txt | 2 +- infer/src/IR/Exceptions.ml | 4 ---- infer/src/IR/Exceptions.mli | 2 -- infer/src/atd/jsonbug.atd | 1 - infer/src/backend/Differential.ml | 1 - infer/src/backend/InferPrint.ml | 4 ---- infer/src/base/Config.ml | 1 - infer/src/base/Config.mli | 1 - infer/src/unit/DifferentialTestsUtils.ml | 11 +++++------ 11 files changed, 8 insertions(+), 23 deletions(-) diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 919cd847d..d6ccf4857 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -440,7 +440,7 @@ OPTIONS multiple times) See also infer-capture(1). --issues-fields ,-separated sequence of { bug_type | bucket | - qualifier | severity | visibility | line | column | procedure | + qualifier | severity | line | column | procedure | procedure_start_line | file | bug_trace | key | hash | line_offset | qualifier_contains_potential_exception_note } Fields to emit with --issues-tests (default: file procedure diff --git a/infer/man/man1/infer-report.txt b/infer/man/man1/infer-report.txt index 69c8f7d1b..3766044c2 100644 --- a/infer/man/man1/infer-report.txt +++ b/infer/man/man1/infer-report.txt @@ -114,7 +114,7 @@ OPTIONS section --issues-fields ,-separated sequence of { bug_type | bucket | - qualifier | severity | visibility | line | column | procedure | + qualifier | severity | line | column | procedure | procedure_start_line | file | bug_trace | key | hash | line_offset | qualifier_contains_potential_exception_note } Fields to emit with --issues-tests (default: file procedure diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index b15b0609a..a747d389d 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -440,7 +440,7 @@ OPTIONS multiple times) See also infer-capture(1). --issues-fields ,-separated sequence of { bug_type | bucket | - qualifier | severity | visibility | line | column | procedure | + qualifier | severity | line | column | procedure | procedure_start_line | file | bug_trace | key | hash | line_offset | qualifier_contains_potential_exception_note } Fields to emit with --issues-tests (default: file procedure diff --git a/infer/src/IR/Exceptions.ml b/infer/src/IR/Exceptions.ml index 6bb27380b..cc8c22bd8 100644 --- a/infer/src/IR/Exceptions.ml +++ b/infer/src/IR/Exceptions.ml @@ -19,10 +19,6 @@ type visibility = let equal_visibility = [%compare.equal: visibility] -let string_of_visibility vis = - match vis with Exn_user -> "user" | Exn_developer -> "developer" | Exn_system -> "system" - - (** class of error/warning *) type err_class = Checker | Prover | Nocat | Linters [@@deriving compare] diff --git a/infer/src/IR/Exceptions.mli b/infer/src/IR/Exceptions.mli index 6131854e9..56ce3e755 100644 --- a/infer/src/IR/Exceptions.mli +++ b/infer/src/IR/Exceptions.mli @@ -19,8 +19,6 @@ type visibility = val equal_visibility : visibility -> visibility -> bool -val string_of_visibility : visibility -> string - (** severity of the report *) type severity = Like | Info | Advice | Warning | Error [@@deriving compare] diff --git a/infer/src/atd/jsonbug.atd b/infer/src/atd/jsonbug.atd index 81d6d7113..a4c0b9595 100644 --- a/infer/src/atd/jsonbug.atd +++ b/infer/src/atd/jsonbug.atd @@ -30,7 +30,6 @@ type jsonbug = { ?doc_url : string option; qualifier : string; severity : string; - ?visibility : string option; line: int; column: int; procedure : string; diff --git a/infer/src/backend/Differential.ml b/infer/src/backend/Differential.ml index fac1352ac..93b941eb9 100644 --- a/infer/src/backend/Differential.ml +++ b/infer/src/backend/Differential.ml @@ -177,7 +177,6 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost = { Jsonbug_j.bug_type= issue_type.IssueType.unique_id ; qualifier ; severity= Exceptions.severity_string severity - ; visibility= Some (Exceptions.string_of_visibility Exceptions.Exn_user) ; line ; column ; procedure= cost_info.Jsonbug_t.procedure_id diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index 85d44d42d..4e9d8b331 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -283,7 +283,6 @@ module JsonIssuePrinter = MakeJsonListPrinter (struct | _ -> None in - let visibility = Some (Exceptions.string_of_visibility err_data.visibility) in let qualifier = let base_qualifier = error_desc_to_plain_string err_key.err_desc in if IssueType.(equal resource_leak) err_key.err_name then @@ -302,7 +301,6 @@ module JsonIssuePrinter = MakeJsonListPrinter (struct { Jsonbug_j.bug_type ; qualifier ; severity - ; visibility ; line= err_data.loc.Location.line ; column= err_data.loc.Location.col ; procedure= procedure_id_of_procname proc_name @@ -397,8 +395,6 @@ let pp_custom_of_report fmt report fields = Format.fprintf fmt "%s%s" (comma_separator index) issue.qualifier | `Issue_field_severity -> Format.fprintf fmt "%s%s" (comma_separator index) issue.severity - | `Issue_field_visibility -> - Format.fprintf fmt "%s%a" (comma_separator index) (Pp.option String.pp) issue.visibility | `Issue_field_line -> Format.fprintf fmt "%s%d" (comma_separator index) issue.line | `Issue_field_column -> diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index 7c5ef88e7..0751ec14a 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -42,7 +42,6 @@ let issues_fields_symbols = ; ("bucket", `Issue_field_bucket) ; ("qualifier", `Issue_field_qualifier) ; ("severity", `Issue_field_severity) - ; ("visibility", `Issue_field_visibility) ; ("line", `Issue_field_line) ; ("column", `Issue_field_column) ; ("procedure", `Issue_field_procedure) diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 67c34e95f..ea3620d0d 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -415,7 +415,6 @@ val issues_fields : | `Issue_field_qualifier | `Issue_field_severity | `Issue_field_bucket - | `Issue_field_visibility | `Issue_field_line | `Issue_field_column | `Issue_field_procedure diff --git a/infer/src/unit/DifferentialTestsUtils.ml b/infer/src/unit/DifferentialTestsUtils.ml index d35341a94..0eeb2674d 100644 --- a/infer/src/unit/DifferentialTestsUtils.ml +++ b/infer/src/unit/DifferentialTestsUtils.ml @@ -8,15 +8,14 @@ open! IStd let create_fake_jsonbug ?(bug_type = "bug_type") ?(qualifier = "qualifier") - ?(severity = "severity") ?(visibility = None) ?(line = 1) ?(column = 1) - ?(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") - ?(dotty = None) ?(infer_source_loc = None) ?(linters_def_file = Some "file/at/certain/path.al") - ?doc_url () : Jsonbug_t.jsonbug = + ?(severity = "severity") ?(line = 1) ?(column = 1) ?(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") ?(dotty = None) + ?(infer_source_loc = None) ?(linters_def_file = Some "file/at/certain/path.al") ?doc_url () : + Jsonbug_t.jsonbug = { bug_type ; qualifier ; severity - ; visibility ; line ; column ; procedure