aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuru Das Srinagesh <quic_gurus@quicinc.com>2022-10-11 12:06:00 -0700
committerMasahiro Yamada <masahiroy@kernel.org>2022-10-14 22:32:52 +0900
commit04518e4c2edc78bc90b4651d50c4aad48d09ac23 (patch)
treeb1165f3263704f6428e116214f1aa6c9b1c0a509
parent11df33c36c4b7a04d2674531f2c6178ad8d61572 (diff)
downloadjikos-04518e4c2edc78bc90b4651d50c4aad48d09ac23.tar.gz
scripts/clang-tools: Convert clang-tidy args to list
Convert list of clang-tidy arguments to a list for ease of adding to them and extending them as required. Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com> Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
-rwxr-xr-xscripts/clang-tools/run-clang-tools.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/clang-tools/run-clang-tools.py b/scripts/clang-tools/run-clang-tools.py
index bb78c9bde55c94..56f2ec8f0f40a7 100755
--- a/scripts/clang-tools/run-clang-tools.py
+++ b/scripts/clang-tools/run-clang-tools.py
@@ -45,13 +45,14 @@ def init(l, a):
def run_analysis(entry):
# Disable all checks, then re-enable the ones we want
- checks = "-checks=-*,"
+ checks = []
+ checks.append("-checks=-*")
if args.type == "clang-tidy":
- checks += "linuxkernel-*"
+ checks.append("linuxkernel-*")
else:
- checks += "clang-analyzer-*"
- checks += ",-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling"
- p = subprocess.run(["clang-tidy", "-p", args.path, checks, entry["file"]],
+ checks.append("clang-analyzer-*")
+ checks.append("-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling")
+ p = subprocess.run(["clang-tidy", "-p", args.path, ",".join(checks), entry["file"]],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
cwd=entry["directory"])