[PATCH] D157773: [clang-tidy] fix None tmpdir when exporting fixes in run-clang-tidy

Julian Schmidt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 12 03:57:26 PDT 2023


5chmidti created this revision.
5chmidti added a project: clang-tools-extra.
Herald added subscribers: PiotrZSL, carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
5chmidti requested review of this revision.
Herald added a subscriber: cfe-commits.

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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157773

Files:
  clang-tools-extra/clang-tidy/tool/run-clang-tidy.py


Index: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
+++ clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
@@ -389,6 +389,8 @@
         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:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157773.549590.patch
Type: text/x-patch
Size: 517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230812/d429e1d3/attachment.bin>


More information about the cfe-commits mailing list