Skip to content

Commit

Permalink
[infer-out] change bugs.txt to report.txt
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jvillard authored and facebook-github-bot committed Mar 26, 2020
1 parent b720c2c commit d8134e3
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion infer/lib/python/inferlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 1 addition & 1 deletion infer/man/man1/infer-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infer/man/man1/infer-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infer/man/man1/infer-run.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion infer/man/man1/infer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion infer/src/base/Config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 \
Expand Down
3 changes: 3 additions & 0 deletions infer/src/base/Config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions infer/src/integration/Driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,18 @@ 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"
(Config.quiet || suppress_console)
[ "--issues-json"
; issues_json
; "--issues-txt"
; bugs_txt
; Config.(results_dir ^/ report_txt)
; "--project-root"
; Config.project_root
; "--results-dir"
Expand Down
4 changes: 2 additions & 2 deletions scripts/make-strict-mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
Expand Down Expand Up @@ -83,7 +83,7 @@ for SOURCE_FILE in $SOURCE_FILES ; do

FULLCLASSNAME="${PACKAGE}.${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
continue
Expand Down
4 changes: 2 additions & 2 deletions website/docs/01-advanced-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ infer-out
├── captured/
├── log/
├── specs/
├── bugs.txt
├── report.json
├── report.txt
├── toplevel.log
└── ...
```
Expand All @@ -28,7 +28,7 @@ infer-out
- `specs/` contains the [specs](advanced-features#print-the-specs) of
each function that was analyzed, as inferred by Infer.
- `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
- there are other folders reserved for Infer's internal workings

Expand Down
2 changes: 1 addition & 1 deletion website/docs/01-infer-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

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.

## Global (default) and differential workflows
Expand Down

0 comments on commit d8134e3

Please sign in to comment.