Fix -allow-enabling-analyzer-alpha-checkers always being passed to run-clang-tidy.py

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.
This commit is contained in:
Joachim Priesner 2020-08-20 09:15:29 -04:00 committed by Aaron Ballman
parent 4457398265
commit 03ded5497a
1 changed files with 1 additions and 1 deletions

View File

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