Call clang-tidy with -quiet unless WITH_TIDY is set.
* Default builds calls clang-tidy only if enabled locally.
In this case, clang-tidy should be quiet.
* If WITH_TIDY is 1 or true, let clang-tidy emit default messages.
* Even with -quiet and all warnings are suppressed,
clang-tidy emits one line message of the number of suppressed messages.
This one-liner could be suppressed in future changes.
Bug: 69051430
Test: default build and build with WITH_TIDY=1
Change-Id: I45303149930b33544e271e6d5eeddf18c9e48d7a
diff --git a/cc/tidy.go b/cc/tidy.go
index 6d7c957..67fd3db 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -77,6 +77,11 @@
flags.TidyFlags = append(flags.TidyFlags, headerFilter)
}
+ // If clang-tidy is not enabled globally, add the -quiet flag.
+ if !ctx.Config().ClangTidy() {
+ flags.TidyFlags = append(flags.TidyFlags, "-quiet")
+ }
+
// We might be using the static analyzer through clang tidy.
// https://bugs.llvm.org/show_bug.cgi?id=32914
flags.TidyFlags = append(flags.TidyFlags, "-extra-arg-before=-D__clang_analyzer__")