[llvm-branch-commits] [clang-tools-extra] 5a60059 - [clang-tidy] fix None tmpdir when exporting fixes in run-clang-tidy
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Aug 14 01:36:57 PDT 2023
Author: Julian Schmidt
Date: 2023-08-14T10:35:36+02:00
New Revision: 5a600592de19655c4ab41ddff738f7082cce17a2
URL: https://github.com/llvm/llvm-project/commit/5a600592de19655c4ab41ddff738f7082cce17a2
DIFF: https://github.com/llvm/llvm-project/commit/5a600592de19655c4ab41ddff738f7082cce17a2.diff
LOG: [clang-tidy] fix None tmpdir when exporting fixes in run-clang-tidy
Differential https://reviews.llvm.org/D145477 removed the check for `(yaml and args.export_fixes)` in line 303 to skip looking for the `clang-apply-replacements` binary. However, the `tmpdir` variable was set in this true branch when exporting fixes and therefore is `None` when invoking run-clang-tidy with `run-clang-tidy -p . -export-fixes fixes.yaml`.
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D157773
(cherry picked from commit c3da99275a520b73235d975017502876e07e3e8e)
Added:
Modified:
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Removed:
################################################################################
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 e0c2d63d2024cf..312d9241cfa57c 100755
--- a/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ b/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -389,6 +389,8 @@ def main():
clang_apply_replacements_binary = find_binary(
args.clang_apply_replacements_binary, "clang-apply-replacements", build_path
)
+
+ if args.fix or (yaml and args.export_fixes):
tmpdir = tempfile.mkdtemp()
try:
More information about the llvm-branch-commits
mailing list