Making rules with Lint
summary
Project adds a custom lint module packaged as an AAR, registers rules via an IssueRegistry, and implements a Detector that overrides getApplicableElements and visitElement to flag ImageView missing src (or enforcing app:srcCompat). Workflow uses a lint baseline to ignore ~existing warnings (about 400 built‑ins) and limits scope to resource files. Performance tips: use AGP 7.0 partial analysis, run a single target variant, avoid checkAllWarnings and test sources, and give lint more RAM — it reduces build time but still can be slow.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 2:00What is Lint
- 2:51Fun fact about Lint
- 3:31Why would I want to create my own rules
- 4:22Adding a link to an existing project
- 5:10Adding a baseline
- 5:27How does it work
- 6:07Baseline
- 6:22Demo
- 8:13Inbuilt Lint
- 15:19Suppress Lint
- 16:51Suppress a class
- 17:24Partial analysis
- 21:46Why use Lint
- 22:19Lint load
- 23:04Questions
related talks
44mLint. What, Why, How?
20mClean Code Base: Harnessing the Power of Android Lint and Custom Rules
27mBuild an Android Lint in 25 Minutes
15mClean Code Base: Harnessing the Power of Android Lint and Custom Rules
29mLint to the Finish Line
46mLint for Life: Your Customizable Guard On the Go
19mThe power of custom lint checks
21mMastering Code Quality: A Deep Dive into Custom Linting for Android Developers
