Commit graph

12 commits

Author SHA1 Message Date
Cole Faust
5d0aaf42db 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
2024-01-29 14:48:23 -08:00
Cole Faust
b765d6bd46 Don't implicitly pick up lint-baseline.xml
lintable modules currently pick up files named "lint-baseline.xml" to
use as the lint baseline implicitly. This is confusing because you could
end up using the baseline files in more modules than intended. Lint also
has a feature where it requests you remove unnecessary findings from the
baseline file, so something could be necessary for one module, but
unnecessary for another that accidentally picked up the baseline.

All modules that used to pick up the baseline implicitly have been
fixed to specify it explicitly already.

Fixes: 272769514
Test: Presubmits
Change-Id: Id17202e2d119b87ab82c18cb35410b93ed8d5071
2024-01-04 10:39:33 -08:00
Colin Cross
f61d03d241 Add TestContext parameter to ContentFromFileRuleForTests
The next CL will need a TestContext parameter in
ContentFromFileRuleForTests in order to retrieve the file rule contents
from the Config.  Add it and update all the tests that use it in order
to simply review of the next CL.

Bug: 306029038
Test: go test ./...
Change-Id: Ia4b4c9854017ea3472fa2f8ba42cf7f72720496e
2023-12-03 17:22:56 -08:00
Cole Faust
69861aa57f Give lint the correct api levels database for the current module
Before this change, lint was always working off of the public
api database. Now, it will have the system, module-lib, or
system-server databases if the current module is compiling
against those SDKs.

This means that a lot more methods are going to start being
checked for NewApi issues.

Bug: 193460475
Test: Errorprone presubmit
Change-Id: I3eb2c617cd61554cd2a3f9d15fd40b3ec91f961d
2023-02-28 21:18:17 -08:00
Cole Faust
1021ccda6b Disable strict_updatability_linting
strict_updatability_linting currently only makes it so
that NewApi can't be added to the lint baseline.
However, since we're updating NewApi to work on a lot
more apis than before, we need to baseline many issues
across the android tree. Temporarily disable
strict_updatability_linting so that we can add these
baselines.

Bug: 193460475
Test: Presubmits
Change-Id: I8d92df95a46e9b903f0cc0e3be56f17722c50430
2023-02-28 11:31:15 -08:00
Pedro Loureiro
33ff1d96fc Fix copy-paste error
Introduced in aosp/1756510

Change-Id: Ib4d0c8fa3c8741bf3e80b8daa53a3d2ce36ce565
Test: presubmit
2022-09-30 17:04:15 +00:00
Pedro Loureiro
ffb643fc18 make system server modules use filtered lint database
Bug: 188851704
Test: m
Change-Id: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
Merged-In: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
2021-07-05 16:57:34 +00:00
Pedro Loureiro
18233a2b47 Use trimmed lint database for mainline modules
Lint's NewApi checks currently produce a lot of false positive findings.
The filtered lint database removes information of classes defined by
mainline modules which are the cases that might become a false positive.

This commit updates soong to use this database instead of the normal one
when linting mainline modules.

Test: m lint-check
Fixes: 186478867
Change-Id: Ica646081b9189303c393b36b2f02914d69eee291
2021-06-25 10:44:59 +00:00
Jaewoong Jung
476b9d6d17 Strict updatability linting against dependencies.
Propagate strict_updatability_linting to transitive dependencies using a
top-down mutator.

Test: lint_test.go
Bug: 182349282
Change-Id: Ifc9e58f1a597e3c7725ee49b4027afb6f42f45cb
2021-05-10 15:30:00 -07:00
Jaewoong Jung
48de883834 Add lint.strict_updatability_linting
The flag prevents developers from skipping updatability lint checks with
baseline files

Test: lint_test.go & manual
Bug: 182349282
Change-Id: Ia74a2b83c7ef686124128bdf16f7b85a919d9e8d
2021-04-21 16:56:49 -07:00
Jaewoong Jung
11623b6052 Move Java lint tests to lint_test.go
Test: lint_test.go
Bug: 182349282
Change-Id: I30a46c8f704e66cd04541c78d3f22a140d3284ef
2021-04-21 16:56:43 -07:00
Jaewoong Jung
79e6f6bfcc Forbid bypassing updatability lint checks.
Test: lint_test.go
Bug: 182349282
Change-Id: Iac7c01493b449c2ddd6df6c68f8a74dfe72dfd7a
2021-04-21 16:56:19 -07:00