Skip to content

Commit

Permalink
[clang-tidy] Do not list enabled checks when -quiet is given to run-c…
Browse files Browse the repository at this point in the history
…lang-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
  • Loading branch information
JonasToth committed May 16, 2019
1 parent 2f677ab commit 3cbf3c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
Expand Up @@ -245,7 +245,12 @@ def main():
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)
Expand Down

0 comments on commit 3cbf3c8

Please sign in to comment.