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 acd1ed6..e6cff6a 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.7.4