summaryrefslogtreecommitdiff
path: root/java/lint_test.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-01-30 00:14:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-01-30 00:14:17 +0000
commit59739666e62b523b81c3c891fbc02cc7b6a7b37c (patch)
tree064d892bb907eed2828440feafa947c723e5f32a /java/lint_test.go
parenta8a5f64222ccaf2fa805c1d87c3985ac640a352f (diff)
parent5d0aaf42dbc6bc3e492c3dd19ff66458baccb587 (diff)
Merge "Prevent disabling checks via flags property" into main
Diffstat (limited to 'java/lint_test.go')
-rw-r--r--java/lint_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/java/lint_test.go b/java/lint_test.go
index b7e6aad8e..751b139e7 100644
--- a/java/lint_test.go
+++ b/java/lint_test.go
@@ -260,3 +260,22 @@ func TestJavaLintDatabaseSelectionFull(t *testing.T) {
}
}
}
+
+func TestCantControlCheckSeverityWithFlags(t *testing.T) {
+ bp := `
+ java_library {
+ name: "foo",
+ srcs: [
+ "a.java",
+ ],
+ min_sdk_version: "29",
+ sdk_version: "current",
+ lint: {
+ flags: ["--disabled", "NewApi"],
+ },
+ }
+ `
+ PrepareForTestWithJavaDefaultModules.
+ ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern("Don't use --disable, --enable, or --check in the flags field, instead use the dedicated disabled_checks, warning_checks, error_checks, or fatal_checks fields")).
+ RunTestWithBp(t, bp)
+}