Index: clang-tidy/tool/run-clang-tidy.py =================================================================== --- clang-tidy/tool/run-clang-tidy.py +++ clang-tidy/tool/run-clang-tidy.py @@ -67,6 +67,11 @@ result += '../' return os.path.realpath(result) +def make_absolute(f, directory): + if os.path.isabs(f): + return f + return os.path.normpath(os.path.join(directory, f)) + def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path, header_filter, extra_arg, extra_arg_before, quiet): @@ -223,7 +228,8 @@ # Load the database and extract all files. database = json.load(open(os.path.join(build_path, db_path))) - files = [entry['file'] for entry in database] + files = [make_absolute(entry['file'], entry['directory']) + for entry in database] max_task = args.j if max_task == 0: