Skip to content

Commit 3cbf3c8

Browse files
committed
[clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy.
Summary: When run-clang-tidy is given the -quiet flag, do not output the potentially hundreds of enabled check names at the beginning. Patch by svenpanne. Reviewers: alexfh, JonasToth Reviewed By: JonasToth Subscribers: JonasToth, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61849 llvm-svn: 360869
1 parent 2f677ab commit 3cbf3c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ def main():
245245
if args.checks:
246246
invocation.append('-checks=' + args.checks)
247247
invocation.append('-')
248-
subprocess.check_call(invocation)
248+
if args.quiet:
249+
# Even with -quiet we still want to check if we can call clang-tidy.
250+
with open(os.devnull, 'w') as dev_null:
251+
subprocess.check_call(invocation, stdout=dev_null)
252+
else:
253+
subprocess.check_call(invocation)
249254
except:
250255
print("Unable to run clang-tidy.", file=sys.stderr)
251256
sys.exit(1)

0 commit comments

Comments
 (0)