From 669cb9150eb47963518e74dfe048578cfa7624c8 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Thu, 4 Jan 2018 01:41:16 -0800 Subject: [PATCH] Call clang-tidy with -fno-caret-diagnostics by default. * clang -fno-caret-diagnostics suppresses warning source lines, carets, and the stats line of "n warnings generated" * clang-tidy -extra-arg-before=-fno-caret-diagnotics only suppresses the "n warnings generated" line. * Pass this flag and -quiet to clang-tidy when WITH_TIDY is not 1 or true. Bug: 69051430 Test: normal build and build with WITH_TIDY=1 Change-Id: I34e34cddc0e7329e73b5f04da4b1458dabfcd4c8 --- cc/tidy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cc/tidy.go b/cc/tidy.go index 67fd3dbce..8ca94efc8 100644 --- a/cc/tidy.go +++ b/cc/tidy.go @@ -80,6 +80,7 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags { // If clang-tidy is not enabled globally, add the -quiet flag. if !ctx.Config().ClangTidy() { flags.TidyFlags = append(flags.TidyFlags, "-quiet") + flags.TidyFlags = append(flags.TidyFlags, "-extra-arg-before=-fno-caret-diagnostics") } // We might be using the static analyzer through clang tidy.