From d8134e39cb1cd15632ce0f0a9f73801b285c34cf Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Thu, 26 Mar 2020 05:14:04 -0700 Subject: [PATCH] [infer-out] change bugs.txt to report.txt Summary: Seems like a more sensible name. Most tooling should read report.json so won't notice. Still output a bugs.txt file with a message to point to report.txt while people migrate. Reviewed By: mityal, artempyanykh Differential Revision: D20626111 fbshipit-source-id: efb84d098 --- infer/lib/python/inferlib/config.py | 2 +- infer/man/man1/infer-full.txt | 2 +- infer/man/man1/infer-report.txt | 2 +- infer/man/man1/infer-run.txt | 2 +- infer/man/man1/infer.txt | 2 +- infer/src/base/Config.ml | 4 +++- infer/src/base/Config.mli | 3 +++ infer/src/integration/Driver.ml | 6 ++++-- scripts/make-strict-mode.sh | 4 ++-- website/docs/01-advanced-features.md | 4 ++-- website/docs/01-infer-workflow.md | 2 +- 11 files changed, 20 insertions(+), 13 deletions(-) diff --git a/infer/lib/python/inferlib/config.py b/infer/lib/python/inferlib/config.py index 41eb4418242..4cad55fd96f 100644 --- a/infer/lib/python/inferlib/config.py +++ b/infer/lib/python/inferlib/config.py @@ -39,7 +39,7 @@ JSON_REPORT_FILENAME = 'report.json' JSON_COSTS_REPORT_FILENAME = 'costs-report.json' INFER_BUCK_DEPS_FILENAME = 'infer-deps.txt' -BUGS_FILENAME = 'bugs.txt' +BUGS_FILENAME = 'report.txt' JAVAC_FILELISTS_FILENAME = 'filelists' PMD_XML_FILENAME = 'report.xml' diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index 382e4a74d43..69bef64efd0 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -188,7 +188,7 @@ OPTIONS --censor-report +string Specify a filter for issues to be censored by adding a 'censored_reason' field in the json report. Infer will not report - censored issues on the console output and in bugs.txt, but tools + censored issues on the console output and in report.txt, but tools that post-process the json report can take them into account. If multiple filters are specified, they are applied in the order in which they are specified. Each filter is applied to each issue diff --git a/infer/man/man1/infer-report.txt b/infer/man/man1/infer-report.txt index 444f58419c8..e2df15731ad 100644 --- a/infer/man/man1/infer-report.txt +++ b/infer/man/man1/infer-report.txt @@ -18,7 +18,7 @@ OPTIONS --censor-report +string Specify a filter for issues to be censored by adding a 'censored_reason' field in the json report. Infer will not report - censored issues on the console output and in bugs.txt, but tools + censored issues on the console output and in report.txt, but tools that post-process the json report can take them into account. If multiple filters are specified, they are applied in the order in which they are specified. Each filter is applied to each issue diff --git a/infer/man/man1/infer-run.txt b/infer/man/man1/infer-run.txt index b6994e8893a..0c64f72ab27 100644 --- a/infer/man/man1/infer-run.txt +++ b/infer/man/man1/infer-run.txt @@ -19,7 +19,7 @@ OPTIONS --censor-report +string Specify a filter for issues to be censored by adding a 'censored_reason' field in the json report. Infer will not report - censored issues on the console output and in bugs.txt, but tools + censored issues on the console output and in report.txt, but tools that post-process the json report can take them into account. If multiple filters are specified, they are applied in the order in which they are specified. Each filter is applied to each issue diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index 88f25b18eb5..7081462526e 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -188,7 +188,7 @@ OPTIONS --censor-report +string Specify a filter for issues to be censored by adding a 'censored_reason' field in the json report. Infer will not report - censored issues on the console output and in bugs.txt, but tools + censored issues on the console output and in report.txt, but tools that post-process the json report can take them into account. If multiple filters are specified, they are applied in the order in which they are specified. Each filter is applied to each issue diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index de9a0a8617a..6ca43a6f777 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -214,6 +214,8 @@ let report_json = "report.json" inconsistencies *) let report_nullable_inconsistency = true +let report_txt = "report.txt" + let reporting_stats_dir_name = "reporting_stats" let retain_cycle_dotty_dir = "retain_cycle_dotty" @@ -821,7 +823,7 @@ and censor_report = CLOpt.mk_string_list ~long:"censor-report" ~deprecated:["-filter-report"] ~in_help:InferCommand.[(Report, manual_generic); (Run, manual_generic)] "Specify a filter for issues to be censored by adding a 'censored_reason' field in the json \ - report. Infer will not report censored issues on the console output and in bugs.txt, but \ + report. Infer will not report censored issues on the console output and in report.txt, but \ tools that post-process the json report can take them into account. If multiple filters are \ specified, they are applied in the order in which they are specified. Each filter is applied \ to each issue detected, and only issues which are accepted by all filters are reported. Each \ diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index 4465bd0ea1f..f82bd5ca045 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -152,6 +152,9 @@ val report_json : string val report_nullable_inconsistency : bool +val report_txt : string +(** name of the file inside infer-out/ containing the issues as human-readable text *) + val reporting_stats_dir_name : string val retain_cycle_dotty_dir : string diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index 831a6bf45c4..ad594f17559 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -288,8 +288,10 @@ let report ?(suppress_console = false) () = | true, _ | false, None -> () | false, Some prog -> + (* Create a dummy bugs.txt file for backwards compatibility. TODO: Stop doing that one day. *) + Utils.with_file_out (Config.results_dir ^/ "bugs.txt") ~f:(fun outc -> + Out_channel.output_string outc "The contents of this file have moved to report.txt.\n" ) ; let if_true key opt args = if not opt then args else key :: args in - let bugs_txt = Config.results_dir ^/ "bugs.txt" in let args = if_true "--pmd-xml" Config.pmd_xml @@ if_true "--quiet" @@ -297,7 +299,7 @@ let report ?(suppress_console = false) () = [ "--issues-json" ; issues_json ; "--issues-txt" - ; bugs_txt + ; Config.(results_dir ^/ report_txt) ; "--project-root" ; Config.project_root ; "--results-dir" diff --git a/scripts/make-strict-mode.sh b/scripts/make-strict-mode.sh index 8b57c8929fb..774ed31198d 100755 --- a/scripts/make-strict-mode.sh +++ b/scripts/make-strict-mode.sh @@ -46,7 +46,7 @@ # Recompile Infer. -SOURCE_FILES=$(grep "error:" infer-out/bugs.txt | cut -f1 -d: | sort -u | grep -v test ) +SOURCE_FILES=$(grep "error:" infer-out/report.txt | cut -f1 -d: | sort -u | grep -v test ) MATCHERS="" cat <