• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

BackCompatJobServiceDetector.mdD25-Apr-20251.2 KiB1611

BackCompatNewFileDetector.mdD25-Apr-20253.9 KiB3929

ErrorLogUtilMockingUsageDetector.mdD25-Apr-20251.3 KiB2920

KillSwitchFlagUsageDetector.mdD25-Apr-2025263 64

README.mdD25-Apr-20251.3 KiB3223

RoomDatabaseMigrationDetector.mdD25-Apr-20255.4 KiB151107

SharedPreferencesUsageDetector.mdD25-Apr-2025900 3523

SystemPropertiesUsageDetector.mdD25-Apr-2025436 76

README.md

1This documentation directory contains files with explanatory information for the linter rules.
2
3# Adding a New Linter
4
5To add a new lint checker, place the detector code in the appropriate package based on whether the
6checker should run against production code (prod), test code (test), or both (common). All common
7Issues need to be added to *both* Issue Registry classes. Tests for the linters are not split out by
8package.
9
10# Testing
11
121. Add appropriate test cases in the `tests` directory.
13
142. Trigger the linter on a specific target locally
15   e.g. `m AdServicesServiceCoreTopicsUnitTests-lint`.
16    1. To debug further and see a complete report of all the linters that ran,
17       open `lint-report.html`, which can be found
18       under `out/soong/.intermediates/{PATH_TO_TARGET}/android_common/lint/`.
19
203. Post a CL to verify linter is triggering on Gerrit.
21
22**NOTE:** Due to b/358643466, linter will not trigger on all targets. If you would like to see the
23linter in action for a specific target impacted by the bug, workaround (only for testing purposes)
24is to list the following explicitly in the target's `Android.bp` file:
25
26```
27lint: {
28            extra_check_modules: ["AdServicesTestLintChecker"],
29            test: false, // TODO(b/343741206): remove when checks will run on android_test
30     },
31```
32