From 0ea850b7a2f7a2003a9466382a32d2be14312966 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Thu, 7 Jan 2016 08:47:54 -0800 Subject: [PATCH] Add dotty file contents to json report Reviewed By: jberdine Differential Revision: D2779944 fb-gh-sync-id: 617ffea --- infer/src/backend/inferprint.ml | 5 +++++ infer/src/backend/jsonbug.atd | 1 + 2 files changed, 6 insertions(+) diff --git a/infer/src/backend/inferprint.ml b/infer/src/backend/inferprint.ml index b2e523c33..04f6cd9e1 100644 --- a/infer/src/backend/inferprint.ml +++ b/infer/src/backend/inferprint.ml @@ -182,6 +182,10 @@ let error_desc_to_plain_string error_desc = let pp fmt () = F.fprintf fmt "%a" Localise.pp_error_desc error_desc in pp_to_string pp () +let error_desc_to_dotty_string error_desc = + let dotty_opt = Localise.error_desc_get_dotty error_desc in + match dotty_opt with Some s -> s | None -> "" + let error_desc_to_xml_string error_desc = let pp fmt () = F.fprintf fmt "%a" Localise.pp_error_desc error_desc in Escape.escape_xml (pp_to_string pp ()) @@ -480,6 +484,7 @@ module BugsJson = struct key = node_key; qualifier_tags = error_desc_to_qualifier_tags_records error_desc; hash = get_bug_hash kind bug_type procedure_id file node_key error_desc; + dotty = error_desc_to_dotty_string error_desc; } in if not !is_first_item then pp "," else is_first_item := false; pp "%s@?" (string_of_jsonbug bug) in diff --git a/infer/src/backend/jsonbug.atd b/infer/src/backend/jsonbug.atd index 92a8a729e..09352672c 100644 --- a/infer/src/backend/jsonbug.atd +++ b/infer/src/backend/jsonbug.atd @@ -25,6 +25,7 @@ type jsonbug = { key : int; qualifier_tags : tag_value_record list; hash : int; + dotty : string; } type json_trace = {