[Infer][Perf] Enrich messages with Markup syntax

Summary:
Messages emitted by cost-analysis now look like the following:
Complexity of this function has **increased** from `O(1)` to `O(n)`.

Reviewed By: mbouaziz

Differential Revision: D13058008

fbshipit-source-id: 119037703
master
Martino Luca 6 years ago committed by Facebook Github Bot
parent b42d625606
commit 71d5b2f8ff

@ -150,9 +150,13 @@ let issue_of_cost cost_info ~delta ~prev_cost ~curr_cost =
CostDomain.BasicCost.pp_degree cost_polynomial
else ()
in
Format.asprintf "Complexity of this function has %a from %a to %a.%a" pp_delta delta
CostDomain.BasicCost.pp_degree_hum prev_cost CostDomain.BasicCost.pp_degree_hum curr_cost
pp_raw_cost curr_cost
Format.asprintf "Complexity of this function has %a from %a to %a.%a"
(MarkupFormatter.wrap_bold pp_delta)
delta
(MarkupFormatter.wrap_monospaced CostDomain.BasicCost.pp_degree_hum)
prev_cost
(MarkupFormatter.wrap_monospaced CostDomain.BasicCost.pp_degree_hum)
curr_cost pp_raw_cost curr_cost
in
let line = cost_info.Jsonbug_t.loc.lnum in
let column = cost_info.Jsonbug_t.loc.cnum in

Loading…
Cancel
Save