From 753580095ea9aed5c594f6adb3f4ba9044a300cd Mon Sep 17 00:00:00 2001 From: Mitya Lyubarskiy Date: Fri, 30 Aug 2019 02:13:42 -0700 Subject: [PATCH] make --debug option side-effect free Summary: I found it very confusing that running infer with --debug makes the report to be different. Intuitively, I expect (and I think majority of users would expect) that `--debug` makes things more verbose (and potentially more slow / consuming more memory and disk space), but does not change anything apart from it. One pro of preserving existing behavior, pointed by jvillard: - Suppose some check is experimental or disabled in the config. The users expect the issue to be found, but it does not show up. They run `infer --debug` to understand the behavior, and suddenly the issue shows up. I, hovewer, find this pro not important enough and potentially confusing the users even more. (If they want to investigate seriously, they can always use --no-filtering, and there are a lot of cases when the issue does not show up for others, much hard to undertand reasons, than the fact that it is disabled). Reviewed By: jvillard Differential Revision: D17113750 fbshipit-source-id: 46cc93503 --- infer/man/man1/infer-analyze.txt | 2 +- infer/man/man1/infer-capture.txt | 2 +- infer/man/man1/infer-compile.txt | 2 +- infer/man/man1/infer-full.txt | 2 +- infer/man/man1/infer-report.txt | 2 +- infer/man/man1/infer-reportdiff.txt | 2 +- infer/man/man1/infer-run.txt | 2 +- infer/man/man1/infer.txt | 2 +- infer/src/base/Config.ml | 8 ++++---- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/infer/man/man1/infer-analyze.txt b/infer/man/man1/infer-analyze.txt index 7cc64040d..91dd83967 100644 --- a/infer/man/man1/infer-analyze.txt +++ b/infer/man/man1/infer-analyze.txt @@ -73,7 +73,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer-capture.txt b/infer/man/man1/infer-capture.txt index 9989f4d8f..3a1b89ae6 100644 --- a/infer/man/man1/infer-capture.txt +++ b/infer/man/man1/infer-capture.txt @@ -26,7 +26,7 @@ DESCRIPTION OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer-compile.txt b/infer/man/man1/infer-compile.txt index 020f62fc2..956f6f8e7 100644 --- a/infer/man/man1/infer-compile.txt +++ b/infer/man/man1/infer-compile.txt @@ -16,7 +16,7 @@ DESCRIPTION OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer-full.txt b/infer/man/man1/infer-full.txt index fb51f05f5..ffbee92a8 100644 --- a/infer/man/man1/infer-full.txt +++ b/infer/man/man1/infer-full.txt @@ -261,7 +261,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) See also infer-analyze(1), infer-capture(1), infer-compile(1), diff --git a/infer/man/man1/infer-report.txt b/infer/man/man1/infer-report.txt index cb6b37956..db2b9dc38 100644 --- a/infer/man/man1/infer-report.txt +++ b/infer/man/man1/infer-report.txt @@ -37,7 +37,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer-reportdiff.txt b/infer/man/man1/infer-reportdiff.txt index 77fb2a3a6..f2ee623f0 100644 --- a/infer/man/man1/infer-reportdiff.txt +++ b/infer/man/man1/infer-reportdiff.txt @@ -28,7 +28,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer-run.txt b/infer/man/man1/infer-run.txt index 2702c5052..46100148a 100644 --- a/infer/man/man1/infer-run.txt +++ b/infer/man/man1/infer-run.txt @@ -38,7 +38,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) diff --git a/infer/man/man1/infer.txt b/infer/man/man1/infer.txt index 5eac612a9..d46fea83f 100644 --- a/infer/man/man1/infer.txt +++ b/infer/man/man1/infer.txt @@ -261,7 +261,7 @@ OPTIONS --debug,-g Activates: Debug mode (also sets --debug-level 2, - --developer-mode, --no-filtering, --print-buckets, --print-types, + --developer-mode, --print-buckets, --print-types, --reports-include-ml-loc, --no-only-cheap-debug, --trace-error, --write-dotty, --write-html) (Conversely: --no-debug | -G) See also infer-analyze(1), infer-capture(1), infer-compile(1), diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index c99651beb..9ba9b4da9 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1232,9 +1232,9 @@ and ( biabduction_models_mode let debug = CLOpt.mk_bool_group ~deprecated:["debug"; "-stats"] ~long:"debug" ~short:'g' ~in_help:all_generic_manuals - "Debug mode (also sets $(b,--debug-level 2), $(b,--developer-mode), $(b,--no-filtering), \ - $(b,--print-buckets), $(b,--print-types), $(b,--reports-include-ml-loc), \ - $(b,--no-only-cheap-debug), $(b,--trace-error), $(b,--write-dotty), $(b,--write-html))" + "Debug mode (also sets $(b,--debug-level 2), $(b,--developer-mode), $(b,--print-buckets), \ + $(b,--print-types), $(b,--reports-include-ml-loc), $(b,--no-only-cheap-debug), \ + $(b,--trace-error), $(b,--write-dotty), $(b,--write-html))" ~f:(fun debug -> if debug then set_debug_level 2 else set_debug_level 0 ; CommandLineOption.keep_args_file := debug ; @@ -1246,7 +1246,7 @@ and ( biabduction_models_mode ; trace_error ; write_html ; write_dotty ] - [filtering; only_cheap_debug] + [only_cheap_debug] and (_ : int option ref) = CLOpt.mk_int_opt ~long:"debug-level" ~in_help:all_generic_manuals ~meta:"level" ~f:(fun level -> set_debug_level level ; level)