Custom Lint Rules
summary
Team uses Android Lint with custom detectors written in Kotlin, shipping 20–25 custom rules that catch project-specific mistakes (e.g., wrong requestCode comparisons) and prevent regressions. Rules run via Gradle/IDE, can fail the build, and include unit tests using Lint test infra; quick fixes are implemented as auto-fix (Alt+Enter) actions. Performance impact is small—example detector ~50 ms, full-run under a second on a large codebase—while pitfalls include cross-module annotation edge cases and the need for careful tests.
AI-written summary · about
chapters (10)
- 0:00Introduction to custom lint rules
- 3:14Static analysis overview
- 7:34Android Lint features
- 10:22Why write custom lint rules
- 15:27Setting up lint environment
- 20:52Writing a custom detector
- 26:32Lint fixes and automation
- 31:08Testing and debugging lint rules
- 35:02Useful resources and community
- 37:59Q&A session
