[config] kill --bugs-json option

Summary:
Allowing the user to configure where to store the JSON report is asking for
trouble. In fact, some places in the code hardcoded "results.json" anyway.

Someone wanting to have results.json somewhere else can still copy report.json
once infer has run.

Reviewed By: jberdine

Differential Revision: D5415079

fbshipit-source-id: 9439cb6
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 9a2746c143
commit b0c2cfd7d4

@ -1106,5 +1106,3 @@ let main ~report_csv ~report_json =
; (Summary, init_summary_format_list ()) ]
in
register_perf_stats_report () ; print_issues formats_by_report_kind
let main_from_config () = main ~report_csv:Config.bugs_csv ~report_json:Config.bugs_json

@ -12,5 +12,3 @@ open! IStd
val exception_value : string
val main : report_csv:string option -> report_json:string option -> unit
val main_from_config : unit -> unit

@ -103,7 +103,16 @@ let () =
in
ClangWrapper.exe ~prog ~args
| Report
-> InferPrint.main_from_config ()
-> let report_json =
match Config.from_json_report with
| None
-> Some Config.(results_dir ^/ report_json)
| Some _
-> (* if we start from a json report instead of the specs, do not generate a json report
again *)
None
in
InferPrint.main ~report_csv:Config.bugs_csv ~report_json
| ReportDiff
-> (* at least one report must be passed in input to compute differential *)
( match (Config.report_current, Config.report_previous) with

@ -212,6 +212,8 @@ let property_attributes = "property_attributes"
let report_condition_always_true_in_clang = false
let report_json = "report.json"
(** If true, sanity-check inferred preconditions against Nullable annotations and report
inconsistencies *)
let report_nullable_inconsistency = true
@ -679,27 +681,22 @@ and buck_out =
and bugs_csv =
CLOpt.mk_path_opt ~deprecated:["bugs"] ~long:"issues-csv"
~in_help:CLOpt.([(Report, manual_generic)])
~meta:"file" "Write a list of issues in CSV format to a file"
and bugs_json =
CLOpt.mk_path_opt ~deprecated:["bugs_json"] ~long:"issues-json"
~in_help:CLOpt.([(Report, manual_generic)])
~meta:"file" "Write a list of issues in JSON format to a file"
~meta:"file" "Write a list of issues in CSV format to $(i,file)"
and bugs_tests =
CLOpt.mk_path_opt ~long:"issues-tests"
~in_help:CLOpt.([(Report, manual_generic)])
~meta:"file" "Write a list of issues in a format suitable for tests to a file"
~meta:"file" "Write a list of issues in a format suitable for tests to $(i,file)"
and bugs_txt =
CLOpt.mk_path_opt ~deprecated:["bugs_txt"] ~long:"issues-txt"
~in_help:CLOpt.([(Report, manual_generic)])
~meta:"file" "Write a list of issues in TXT format to a file"
~meta:"file" "Write a list of issues in text format to $(i,file)"
and calls_csv =
CLOpt.mk_path_opt ~deprecated:["calls"] ~long:"calls-csv"
~in_help:CLOpt.([(Report, manual_generic)])
~meta:"file" "Write individual calls in CSV format to a file"
~meta:"file" "Write individual calls in CSV format to $(i,file)"
and changed_files_index =
CLOpt.mk_path_opt ~long:"changed-files-index"
@ -1788,8 +1785,6 @@ and bufferoverrun = !bufferoverrun
and bugs_csv = !bugs_csv
and bugs_json = !bugs_json
and frontend_tests = !frontend_tests
and generated_classes = !generated_classes

@ -195,6 +195,8 @@ val report_condition_always_true_in_clang : bool
val report_custom_error : bool
val report_json : string
val report_nullable_inconsistency : bool
val reporting_stats_dir_name : string
@ -289,8 +291,6 @@ val bufferoverrun : bool
val bugs_csv : string option
val bugs_json : string option
val bugs_tests : string option
val bugs_txt : string option

@ -148,7 +148,7 @@ let clean_results_dir () =
in
fun name ->
(* Keep the JSON report *)
not (String.equal (Filename.basename name) "report.json")
not (String.equal (Filename.basename name) Config.report_json)
&& List.exists ~f:(Filename.check_suffix name) suffixes_to_delete
in
let rec clean name =
@ -356,7 +356,7 @@ let report () =
let report_csv =
if Config.buck_cache_mode then None else Some (Config.results_dir ^/ "report.csv")
in
let report_json = Some (Config.results_dir ^/ "report.json") in
let report_json = Some Config.(results_dir ^/ report_json) in
InferPrint.main ~report_csv ~report_json ;
(* Post-process the report according to the user config. By default, calls report.py to create a
human-readable report.
@ -405,7 +405,7 @@ let analyze_and_report ~changed_files driver_mode =
(** as the Config.fail_on_bug flag mandates, exit with error when an issue is reported *)
let fail_on_issue_epilogue () =
let issues_json =
DB.Results_dir.(path_to_filename Abs_root ["report.json"]) |> DB.filename_to_string
DB.Results_dir.(path_to_filename Abs_root [Config.report_json]) |> DB.filename_to_string
in
match Utils.read_file issues_json with
| Ok lines

Loading…
Cancel
Save