From b2085f19dcf18b10b0c9843f7d29e9be107d290c Mon Sep 17 00:00:00 2001 From: Serikzhan Kazi Date: Sun, 9 Jan 2022 12:50:12 +0100 Subject: clang-tools-extra: apply upstream patch run-clang-tidy.py is being run on unique files only when using this patch Signed-off-by: Serikzhan Kazi (cherry picked from commit 414445a701a68a46627d2aa072ee737c50ceb751) --- .../0039-run-clang-tidy-on-unique-files-only.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch diff --git a/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch b/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch new file mode 100644 index 0000000..500be31 --- /dev/null +++ b/recipes-devtools/clang/clang/0039-run-clang-tidy-on-unique-files-only.patch @@ -0,0 +1,31 @@ +From 0dc856ed20e0fb64dd7cb0a10db35c58c3ef95e6 Mon Sep 17 00:00:00 2001 +From: Serikzhan Kazi +Date: Sat, 6 Nov 2021 19:53:18 +1300 +Subject: [PATCH] [clang-tidy] run-clang-tidy.py: analyze unique files only + +The files in compile-commands.json can potentially include duplicates. +Change run-clang-tidy.py so that it does not run on the duplicate entries. + +Differential Revision: https://reviews.llvm.org/D112926 +--- + clang-tools-extra/clang-tidy/tool/run-clang-tidy.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +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 acd1ed6979c0..e6cff6a7414d 100755 +--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py ++++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +@@ -273,8 +273,8 @@ def main(): + + # Load the database and extract all files. + database = json.load(open(os.path.join(build_path, db_path))) +- files = [make_absolute(entry['file'], entry['directory']) +- for entry in database] ++ files = set([make_absolute(entry['file'], entry['directory']) ++ for entry in database]) + + max_task = args.j + if max_task == 0: +-- +2.34.1 + -- cgit v1.2.3-54-g00ecf