Lint
Purpose: Two custom lint checks, published to every module that depends on core:ui via
lintPublish(projects.lint) (core/ui/build.gradle.kts) โ no per-module wiring needed.
Key APIs
| API | What it does |
|---|---|
DesignSystemDetector |
ERROR-severity โ flags a raw Material 3 composable (Button, TextField, *TopAppBar, โฆ) that has a Jetpack* equivalent, resolved by symbol not by name |
TestMethodNameDetector |
WARNING-severity โ flags a @Test method whose name starts with test; the annotation already says what it is |
JetpackIssueRegistry |
Registers both checks; declares the Vendor metadata lint shows in its output |
// lint/src/main/kotlin/dev/atick/lint/JetpackIssueRegistry.kt
override val issues = listOf(
DesignSystemDetector.ISSUE,
TestMethodNameDetector.PREFIX,
)
Gotchas
TestMethodNameDetectorchecks methods annotated withorg.junit.Testwhose names start with lowercasetest; it does not enforce a sentence orgiven_when_thenformat.- Run
./gradlew :lint:testafter changing a detector. The component guide covers adding a wrapper and updating detector coverage; custom lint runs in consuming modules through Android lint.
Related Documentation
- Components ยง Enforcement โ the full
DesignSystemDetectorrationale and its method-name table