Building a better codebase with Lint
summary
Shows how to build a custom lint rule module that registers an IssueRegistry, implements a resource XML detector that flags a V1→V2 style detector (uses getApplicableElements, appliesTo layout, visitElement), and supplies a two-step lintfix autofix (unset then set attribute). Includes unit tests with the lint testing lib, explains baseline-driven incremental fixes, notes lintfix fails on first run then passes after fixes, and points out Android ships >100 default checks.
AI-written summary · about
chapters (16)
- 0:00Introduction to Lint
- 1:56Why use Lint in projects
- 4:47Benefits of custom lint rules
- 5:51Setting up lint module
- 8:00Key lint concepts
- 10:49Writing custom lint rules
- 14:05Creating detectors
- 17:22Adding fixes to lint rules
- 19:50Autofixing lint issues
- 20:35Testing lint rules
- 25:33Integrating lint in codebase
- 27:43Using baseline for incremental fixes
- 28:47Lint rule performance types
- 30:11Kotlin considerations for lint
- 31:36Resources for learning lint
- 32:20Q&A session
related talks
21mMastering Code Quality: A Deep Dive into Custom Linting for Android Developers
44mLint. What, Why, How?
46mLint for Life: Your Customizable Guard On the Go
21mGetting the most out of Android Lint
15mClean Code Base: Harnessing the Power of Android Lint and Custom Rules
20mClean Code Base: Harnessing the Power of Android Lint and Custom Rules
19mThe power of custom lint checks
29mLint to the Finish Line
