Fix -allow-enabling-analyzer-alpha-checkers always being passed to run-clang-tidy.py
authorJoachim Priesner <llvm-project-704996@jspam.de>
Thu, 20 Aug 2020 13:15:29 +0000 (09:15 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 20 Aug 2020 13:15:29 +0000 (09:15 -0400)
The action='store_true' option of argparse.add_argument implicitly
generates a default value of False if the argument is not specified.
Thus, the allow_enabling_alpha_checkers argument of
get_tidy_invocation is never None.

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

index 4272ae0..7e23419 100755 (executable)
@@ -84,7 +84,7 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
                         extra_arg, extra_arg_before, quiet, config):
   """Gets a command line for clang-tidy."""
   start = [clang_tidy_binary]
-  if allow_enabling_alpha_checkers is not None:
+  if allow_enabling_alpha_checkers:
     start.append('-allow-enabling-analyzer-alpha-checkers')
   if header_filter is not None:
     start.append('-header-filter=' + header_filter)