0

AW docs: explain how to run Android Lint

This updates the lint.md document to explain that lint should be run by
compiling the GN target.

Change-Id: Ic9665223814f15096809e66f514b64475f428261
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5430653
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1285119}
This commit is contained in:
Nate Fischer
2024-04-10 14:38:05 +00:00
committed by Chromium LUCI CQ
parent 8bc6f4b0e5
commit 80e5d0bf20

@ -14,10 +14,26 @@ This is a [list of checks] that you might encounter.
## How Chromium uses lint
Chromium only runs lint on apk or bundle targets that explicitly set
`enable_lint = true`. Some example targets that have this set are:
`enable_lint = true`. You can run lint by compiling the apk or bundle target
with ninja; once the code finishes compiling, ninja will automatically run lint
on the code.
Some example targets that have lint enabled are:
- `//chrome/android:monochrome_public_bundle`
- `//android_webview/support_library/boundary_interfaces:boundary_interface_example_apk`
- Other targets with `enable_lint` enabled: https://source.chromium.org/search?q=lang:gn%20enable_lint%5C%20%3D%5C%20true&ss=chromium
If you think lint is not running and already verified your GN
target has `enable_lint = true`, then you can double check that
`android_static_analysis` is set to `"on"` (this is the default value):
```shell
$ gn args out/Default --list=android_static_analysis
android_static_analysis
Current value (from the default) = "on"
From //build/config/android/config.gni:85
```
## My code has a lint error