[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
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent b720c2ca61
commit d8134e39cb

@ -39,7 +39,7 @@ DEFAULT_INFER_OUT = os.path.join(os.getcwd().decode(CODESET), 'infer-out')
JSON_REPORT_FILENAME = 'report.json' JSON_REPORT_FILENAME = 'report.json'
JSON_COSTS_REPORT_FILENAME = 'costs-report.json' JSON_COSTS_REPORT_FILENAME = 'costs-report.json'
INFER_BUCK_DEPS_FILENAME = 'infer-deps.txt' INFER_BUCK_DEPS_FILENAME = 'infer-deps.txt'
BUGS_FILENAME = 'bugs.txt' BUGS_FILENAME = 'report.txt'
JAVAC_FILELISTS_FILENAME = 'filelists' JAVAC_FILELISTS_FILENAME = 'filelists'
PMD_XML_FILENAME = 'report.xml' PMD_XML_FILENAME = 'report.xml'

@ -188,7 +188,7 @@ OPTIONS
--censor-report +string --censor-report +string
Specify a filter for issues to be censored by adding a Specify a filter for issues to be censored by adding a
'censored_reason' field in the json report. Infer will not report '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 that post-process the json report can take them into account. If
multiple filters are specified, they are applied in the order in multiple filters are specified, they are applied in the order in
which they are specified. Each filter is applied to each issue which they are specified. Each filter is applied to each issue

@ -18,7 +18,7 @@ OPTIONS
--censor-report +string --censor-report +string
Specify a filter for issues to be censored by adding a Specify a filter for issues to be censored by adding a
'censored_reason' field in the json report. Infer will not report '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 that post-process the json report can take them into account. If
multiple filters are specified, they are applied in the order in multiple filters are specified, they are applied in the order in
which they are specified. Each filter is applied to each issue which they are specified. Each filter is applied to each issue

@ -19,7 +19,7 @@ OPTIONS
--censor-report +string --censor-report +string
Specify a filter for issues to be censored by adding a Specify a filter for issues to be censored by adding a
'censored_reason' field in the json report. Infer will not report '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 that post-process the json report can take them into account. If
multiple filters are specified, they are applied in the order in multiple filters are specified, they are applied in the order in
which they are specified. Each filter is applied to each issue which they are specified. Each filter is applied to each issue

@ -188,7 +188,7 @@ OPTIONS
--censor-report +string --censor-report +string
Specify a filter for issues to be censored by adding a Specify a filter for issues to be censored by adding a
'censored_reason' field in the json report. Infer will not report '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 that post-process the json report can take them into account. If
multiple filters are specified, they are applied in the order in multiple filters are specified, they are applied in the order in
which they are specified. Each filter is applied to each issue which they are specified. Each filter is applied to each issue

@ -214,6 +214,8 @@ let report_json = "report.json"
inconsistencies *) inconsistencies *)
let report_nullable_inconsistency = true let report_nullable_inconsistency = true
let report_txt = "report.txt"
let reporting_stats_dir_name = "reporting_stats" let reporting_stats_dir_name = "reporting_stats"
let retain_cycle_dotty_dir = "retain_cycle_dotty" 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"] CLOpt.mk_string_list ~long:"censor-report" ~deprecated:["-filter-report"]
~in_help:InferCommand.[(Report, manual_generic); (Run, manual_generic)] ~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 \ "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 \ 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 \ 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 \ to each issue detected, and only issues which are accepted by all filters are reported. Each \

@ -152,6 +152,9 @@ val report_json : string
val report_nullable_inconsistency : bool 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 reporting_stats_dir_name : string
val retain_cycle_dotty_dir : string val retain_cycle_dotty_dir : string

@ -288,8 +288,10 @@ let report ?(suppress_console = false) () =
| true, _ | false, None -> | true, _ | false, None ->
() ()
| false, Some prog -> | 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 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 = let args =
if_true "--pmd-xml" Config.pmd_xml if_true "--pmd-xml" Config.pmd_xml
@@ if_true "--quiet" @@ if_true "--quiet"
@ -297,7 +299,7 @@ let report ?(suppress_console = false) () =
[ "--issues-json" [ "--issues-json"
; issues_json ; issues_json
; "--issues-txt" ; "--issues-txt"
; bugs_txt ; Config.(results_dir ^/ report_txt)
; "--project-root" ; "--project-root"
; Config.project_root ; Config.project_root
; "--results-dir" ; "--results-dir"

@ -46,7 +46,7 @@
# Recompile Infer. # 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="" MATCHERS=""
cat <<EOF cat <<EOF
@ -83,7 +83,7 @@ for SOURCE_FILE in $SOURCE_FILES ; do
FULLCLASSNAME="${PACKAGE}.${CLASS}" FULLCLASSNAME="${PACKAGE}.${CLASS}"
METHOD_REXP="^ Method \`.* $CLASS\." METHOD_REXP="^ Method \`.* $CLASS\."
METHODS=$(grep -E "$METHOD_REXP" infer-out/bugs.txt | cut -f2 -d. | cut -f1 -d\` | sort -u) METHODS=$(grep -E "$METHOD_REXP" infer-out/report.txt | cut -f2 -d. | cut -f1 -d\` | sort -u)
if [ -z "$METHODS" ] ; then if [ -z "$METHODS" ] ; then
continue continue

@ -17,8 +17,8 @@ infer-out
├── captured/ ├── captured/
├── log/ ├── log/
├── specs/ ├── specs/
├── bugs.txt
├── report.json ├── report.json
├── report.txt
├── toplevel.log ├── toplevel.log
└── ... └── ...
``` ```
@ -28,7 +28,7 @@ infer-out
- `specs/` contains the [specs](advanced-features#print-the-specs) of - `specs/` contains the [specs](advanced-features#print-the-specs) of
each function that was analyzed, as inferred by Infer. each function that was analyzed, as inferred by Infer.
- `log/` and toplevel.log contains logs - `log/` and toplevel.log contains logs
- `bugs.txt` and `report.json` contain the Infer reports in text and JSON - `report.txt` and `report.json` contain the Infer reports in text and JSON
formats formats
- there are other folders reserved for Infer's internal workings - there are other folders reserved for Infer's internal workings

@ -61,7 +61,7 @@ would be to run Infer on your code, fix the errors generated, and run it again
to find possibly more errors or to check that all the errors have been fixed. to find possibly more errors or to check that all the errors have been fixed.
The errors will be displayed in the standard output and also in a file The errors will be displayed in the standard output and also in a file
`infer-out/bugs.txt`. We filter the bugs and show the ones that are most likely `infer-out/report.txt`. We filter the bugs and show the ones that are most likely
to be real. to be real.
## Global (default) and differential workflows ## Global (default) and differential workflows

Loading…
Cancel
Save