Add clang-analyzer check if selected.
* WITH_TIDY=1 should not include clang-analyzer-* checks because they are too slow. * Nightly builds will use both WITH_TIDY=1 and CLANG_ANALYZER_CHECKS=1. Bug: 173736193 Test: make with WITH_TIDY=1 and CLANG_ANALYZER_CHECKS=1 Change-Id: I3885fd0e20475ceee5e3798bffc11a61994ac113
This commit is contained in:
parent
9bd66d1537
commit
04f8d379e6
|
@ -29,15 +29,12 @@ func init() {
|
|||
if override := ctx.Config().Getenv("DEFAULT_GLOBAL_TIDY_CHECKS"); override != "" {
|
||||
return override
|
||||
}
|
||||
return strings.Join([]string{
|
||||
checks := strings.Join([]string{
|
||||
"-*",
|
||||
"abseil-*",
|
||||
"android-*",
|
||||
"bugprone-*",
|
||||
"cert-*",
|
||||
// clang-analyzer-* check is slow and enables clang-diagnostic-padded,
|
||||
// which cannot be suppressed yet.
|
||||
// "clang-analyzer-*",
|
||||
"clang-diagnostic-unused-command-line-argument",
|
||||
"google-*",
|
||||
"misc-*",
|
||||
|
@ -63,6 +60,14 @@ func init() {
|
|||
// -readability-*
|
||||
// -zircon-*
|
||||
}, ",")
|
||||
// clang-analyzer-* checks are too slow to be in the default for WITH_TIDY=1.
|
||||
// nightly builds add CLANG_ANALYZER_CHECKS=1 to run those checks.
|
||||
// Some test code have clang-diagnostic-padded warnings that cannot be
|
||||
// suppressed, but only by disabling clang-analyzer-optin.performance.*.
|
||||
if ctx.Config().IsEnvTrue("CLANG_ANALYZER_CHECKS") {
|
||||
checks += ",clang-analyzer-*,-clang-analyzer-optin.performance.*"
|
||||
}
|
||||
return checks
|
||||
})
|
||||
|
||||
// There are too many clang-tidy warnings in external and vendor projects.
|
||||
|
|
Loading…
Reference in New Issue