From e17645fe304994ab999196c9dc3fb3dd9c6ab36a Mon Sep 17 00:00:00 2001 From: mattgilbride Date: Fri, 18 Nov 2022 18:20:20 +0000 Subject: [PATCH] lint: always run module specified in ANDROID_LINT_CHECK_EXTRA_MODULES Before this change, ANDROID_LINT_EXTRA_CHECK_MODULES was only read if ANDROID_LINT_CHECK was also set. This change allows an entire module of checks to be added to lint without having to specify all of the individuals with ANDROID_LINT_CHECK. This is part of a workaround to run some lint checks globally, but is useful to provide more flexibility generally. Bug: 236558918 Test: manually tested with AndroidFrameworkLintChecker Change-Id: I2d3ec8a997d902c9d00a577a56f4b152b10e078a --- java/lint.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/java/lint.go b/java/lint.go index 9827159c8..7a6e5d9c1 100644 --- a/java/lint.go +++ b/java/lint.go @@ -190,10 +190,8 @@ func (l *linter) deps(ctx android.BottomUpMutatorContext) { extraCheckModules := l.properties.Lint.Extra_check_modules - if checkOnly := ctx.Config().Getenv("ANDROID_LINT_CHECK"); checkOnly != "" { - if checkOnlyModules := ctx.Config().Getenv("ANDROID_LINT_CHECK_EXTRA_MODULES"); checkOnlyModules != "" { - extraCheckModules = strings.Split(checkOnlyModules, ",") - } + if extraCheckModulesEnv := ctx.Config().Getenv("ANDROID_LINT_CHECK_EXTRA_MODULES"); extraCheckModulesEnv != "" { + extraCheckModules = append(extraCheckModules, strings.Split(extraCheckModulesEnv, ",")...) } ctx.AddFarVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(),