From 1951fe5cf0a69b0467859a35cc8e06c16de0a76a Mon Sep 17 00:00:00 2001 From: "Mark A. Tsuchida" Date: Sun, 16 Jun 2024 17:50:06 -0500 Subject: [PATCH] clang-tidy: use -quiet This adds the `-quiet` option when invoking clang-tidy for the generated `clang-tidy` target. (Note that the `clang-tidy-fix` target already does so.) This prevents messages like ``` Suppressed 1084 warnings (1084 in non-user code). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. ``` from being repeated for every file, which drowns out the actual warnings/errors from clang-tidy when more than a few files are processed. Also the tip about `-header-fileter` and `-system-headers` is not very useful here because Meson doesn't currently provide a way to supply these options to clang-tidy. Even with `-quiet`, clang-tidy still prints a line like `1084 warnings generated.` for each file. --- mesonbuild/scripts/clangtidy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/scripts/clangtidy.py b/mesonbuild/scripts/clangtidy.py index 353cdc19c..1e0c4a5a3 100644 --- a/mesonbuild/scripts/clangtidy.py +++ b/mesonbuild/scripts/clangtidy.py @@ -11,7 +11,7 @@ from .run_tool import run_tool import typing as T def run_clang_tidy(fname: Path, builddir: Path) -> subprocess.CompletedProcess: - return subprocess.run(['clang-tidy', '-p', str(builddir), str(fname)]) + return subprocess.run(['clang-tidy', '-quiet', '-p', str(builddir), str(fname)]) def run_clang_tidy_fix(fname: Path, builddir: Path) -> subprocess.CompletedProcess: return subprocess.run(['run-clang-tidy', '-fix', '-format', '-quiet', '-p', str(builddir), str(fname)])