[llvm-branch-commits] [clang-tools-extra] 1596c2d - Fix -allow-enabling-analyzer-alpha-checkers always being passed to run-clang-tidy.py
Andi-Bogdan Postelnicu via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Sep 15 09:27:18 PDT 2020
Author: Joachim Priesner
Date: 2020-09-15T19:26:57+03:00
New Revision: 1596c2dfd548b21cf33ad3353882ac465d78c1bb
URL: https://github.com/llvm/llvm-project/commit/1596c2dfd548b21cf33ad3353882ac465d78c1bb
DIFF: https://github.com/llvm/llvm-project/commit/1596c2dfd548b21cf33ad3353882ac465d78c1bb.diff
LOG: 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.
Added:
Modified:
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
index 4272ae0957fe..7e23419cd916 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -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)
More information about the llvm-branch-commits
mailing list