[PATCH] D61849: Do not list enabled checks when -quiet is given to run-clang-tidy.

Jonas Toth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 02:20:42 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL360869: [clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy. (authored by JonasToth, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61849?vs=199229&id=199769#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61849/new/

https://reviews.llvm.org/D61849

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


Index: clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py
===================================================================
--- clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py
+++ clang-tools-extra/trunk/clang-tidy/tool/run-clang-tidy.py
@@ -245,7 +245,12 @@
     if args.checks:
       invocation.append('-checks=' + args.checks)
     invocation.append('-')
-    subprocess.check_call(invocation)
+    if args.quiet:
+      # Even with -quiet we still want to check if we can call clang-tidy.
+      with open(os.devnull, 'w') as dev_null:
+        subprocess.check_call(invocation, stdout=dev_null)
+    else:
+      subprocess.check_call(invocation)
   except:
     print("Unable to run clang-tidy.", file=sys.stderr)
     sys.exit(1)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61849.199769.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190516/7c1d3d47/attachment.bin>


More information about the llvm-commits mailing list