Skip to content

Commit 04518e4

Browse files
Guru Das Srinageshmasahir0y
authored andcommitted
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 <[email protected]> Suggested-by: Nick Desaulniers <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 11df33c commit 04518e4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/clang-tools/run-clang-tools.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ def init(l, a):
4545

4646
def run_analysis(entry):
4747
# Disable all checks, then re-enable the ones we want
48-
checks = "-checks=-*,"
48+
checks = []
49+
checks.append("-checks=-*")
4950
if args.type == "clang-tidy":
50-
checks += "linuxkernel-*"
51+
checks.append("linuxkernel-*")
5152
else:
52-
checks += "clang-analyzer-*"
53-
checks += ",-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling"
54-
p = subprocess.run(["clang-tidy", "-p", args.path, checks, entry["file"]],
53+
checks.append("clang-analyzer-*")
54+
checks.append("-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling")
55+
p = subprocess.run(["clang-tidy", "-p", args.path, ",".join(checks), entry["file"]],
5556
stdout=subprocess.PIPE,
5657
stderr=subprocess.STDOUT,
5758
cwd=entry["directory"])

0 commit comments

Comments
 (0)