Commit 04518e4c authored by Guru Das Srinagesh's avatar Guru Das Srinagesh Committed by Masahiro Yamada

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: default avatarGuru Das Srinagesh <quic_gurus@quicinc.com>
Suggested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 11df33c3
...@@ -45,13 +45,14 @@ def init(l, a): ...@@ -45,13 +45,14 @@ def init(l, a):
def run_analysis(entry): def run_analysis(entry):
# Disable all checks, then re-enable the ones we want # Disable all checks, then re-enable the ones we want
checks = "-checks=-*," checks = []
checks.append("-checks=-*")
if args.type == "clang-tidy": if args.type == "clang-tidy":
checks += "linuxkernel-*" checks.append("linuxkernel-*")
else: else:
checks += "clang-analyzer-*" checks.append("clang-analyzer-*")
checks += ",-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling" checks.append("-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling")
p = subprocess.run(["clang-tidy", "-p", args.path, checks, entry["file"]], p = subprocess.run(["clang-tidy", "-p", args.path, ",".join(checks), entry["file"]],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
cwd=entry["directory"]) cwd=entry["directory"])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment