Promote the NewApi check to an error again
Now that all existing cases have been baselined. Ignore-AOSP-First: Requires a LSC that is difficult to do across branches. Bug: 268261262 Test: m lint-check Change-Id: I413f86ff7a1f33564465f3ba9cd52924a4242901
This commit is contained in:
@@ -319,12 +319,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
|
|||||||
cmd.FlagWithInput("@",
|
cmd.FlagWithInput("@",
|
||||||
android.PathForSource(ctx, "build/soong/java/lint_defaults.txt"))
|
android.PathForSource(ctx, "build/soong/java/lint_defaults.txt"))
|
||||||
|
|
||||||
if l.compileSdkKind == android.SdkPublic {
|
cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
|
||||||
cmd.FlagForEachArg("--error_check ", l.extraMainlineLintErrors)
|
|
||||||
} else {
|
|
||||||
// TODO(b/268261262): Remove this branch. We're demoting NewApi to a warning due to pre-existing issues that need to be fixed.
|
|
||||||
cmd.FlagForEachArg("--warning_check ", l.extraMainlineLintErrors)
|
|
||||||
}
|
|
||||||
cmd.FlagForEachArg("--disable_check ", l.properties.Lint.Disabled_checks)
|
cmd.FlagForEachArg("--disable_check ", l.properties.Lint.Disabled_checks)
|
||||||
cmd.FlagForEachArg("--warning_check ", l.properties.Lint.Warning_checks)
|
cmd.FlagForEachArg("--warning_check ", l.properties.Lint.Warning_checks)
|
||||||
cmd.FlagForEachArg("--error_check ", l.properties.Lint.Error_checks)
|
cmd.FlagForEachArg("--error_check ", l.properties.Lint.Error_checks)
|
||||||
|
@@ -91,9 +91,8 @@ func TestJavaLintUsesCorrectBpConfig(t *testing.T) {
|
|||||||
t.Error("did not use the correct file for baseline")
|
t.Error("did not use the correct file for baseline")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(*sboxProto.Commands[0].Command, "--warning_check NewApi") {
|
if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check NewApi") {
|
||||||
// TODO(b/268261262): Change this to check for --error_check
|
t.Error("should check NewApi errors")
|
||||||
t.Error("should check NewApi warnings")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check SomeCheck") {
|
if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check SomeCheck") {
|
||||||
|
Reference in New Issue
Block a user