From dc0c0302e951f2df8e5896671962ba3e715883d9 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Fri, 15 Dec 2017 20:57:48 -0800 Subject: [PATCH] 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 --- cc/tidy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/tidy.go b/cc/tidy.go index 6d7c95751..67fd3dbce 100644 --- a/cc/tidy.go +++ b/cc/tidy.go @@ -77,6 +77,11 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags { 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__")