diff --git a/scripts/run-clang-tidy-on-compile-commands.py b/scripts/run-clang-tidy-on-compile-commands.py index 9777fe73eaf592..7d51325d7ba22f 100755 --- a/scripts/run-clang-tidy-on-compile-commands.py +++ b/scripts/run-clang-tidy-on-compile-commands.py @@ -189,6 +189,7 @@ def __init__(self): self.fixes_file = None self.fixes_temporary_file_dir = None self.gcc_sysroot = None + self.file_names_to_check = set() if sys.platform == 'darwin': # Darwin gcc invocation will auto select a system root, however clang requires an explicit path since @@ -206,6 +207,11 @@ def AddDatabase(self, compile_commands_json): if not item.valid: continue + if item.file in self.file_names_to_check: + logging.info('Ignoring additional request for checking %s', item.file) + continue + + self.file_names_to_check.add(item.file) self.entries.append(item) def Cleanup(self):