Merge "add more global default checks" am: 9235fea8c3

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1551578

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie87dcfa735db1b56cce50044bd0220cde5a38e29
This commit is contained in:
Treehugger Robot
2021-01-16 01:32:34 +00:00
committed by Automerger Merge Worker

View File

@@ -20,24 +20,46 @@ import (
) )
func init() { func init() {
// Most Android source files are not clang-tidy clean yet. // Many clang-tidy checks like altera-*, llvm-*, modernize-*
// Global tidy checks include only google*, performance*, // are not designed for Android source code or creating too
// and misc-macro-parentheses, but not google-readability* // many (false-positive) warnings. The global default tidy checks
// or google-runtime-references. // should include only tested groups and exclude known noisy checks.
// See https://clang.llvm.org/extra/clang-tidy/checks/list.html
pctx.VariableFunc("TidyDefaultGlobalChecks", func(ctx android.PackageVarContext) string { pctx.VariableFunc("TidyDefaultGlobalChecks", func(ctx android.PackageVarContext) string {
if override := ctx.Config().Getenv("DEFAULT_GLOBAL_TIDY_CHECKS"); override != "" { if override := ctx.Config().Getenv("DEFAULT_GLOBAL_TIDY_CHECKS"); override != "" {
return override return override
} }
return strings.Join([]string{ return strings.Join([]string{
"-*", "-*",
"bugprone*", "abseil-*",
"android-*",
"bugprone-*",
"cert-*",
"clang-analyzer-*",
"clang-diagnostic-unused-command-line-argument", "clang-diagnostic-unused-command-line-argument",
"google*", "google-*",
"misc-macro-parentheses", "misc-*",
"performance*", "performance-*",
"portability-*",
"-bugprone-narrowing-conversions", "-bugprone-narrowing-conversions",
"-google-readability*", "-google-readability*",
"-google-runtime-references", "-google-runtime-references",
"-misc-no-recursion",
"-misc-non-private-member-variables-in-classes",
"-misc-unused-parameters",
// the following groups are excluded by -*
// -altera-*
// -cppcoreguidelines-*
// -darwin-*
// -fuchsia-*
// -hicpp-*
// -llvm-*
// -llvmlibc-*
// -modernize-*
// -mpi-*
// -objc-*
// -readability-*
// -zircon-*
}, ",") }, ",")
}) })