Prevent disabling checks via flags property
strict_updatability_linting currently only checks that updatability checks aren't disabled via disabled_checks / warning_checks, you could get around it using the `flags` property. Only allow controlling checks via the *_checks properties. Bug: 322802379 Test: m nothing --no-skip-soong-tests Change-Id: Ia311622e1409f9cc201ab55f8749f2d13fccf551
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user