Kotlin Static Analysis with Android Lint
summary
Android Lint supports Kotlin and already ships about 315 checks, runs ~75% of those on the fly in the editor, and now runs outside Android via a Gradle plugin for pure Kotlin projects. It exposes a detector API, uses UAST to analyze Java and Kotlin uniformly, loads custom lint checks from AARs, and packages quickfix descriptors plus a rich unit-test DSL. It enforces a ~40-check “target lint vital” on release builds, offers a baseline workflow to ignore existing warnings, and is adding an expensive but usable call-graph for interprocedural analysis.
AI-written summary · about
chapters (31)
- 0:00Intro
- 0:23Outline
- 1:58Annotation Checks
- 3:44Lint Features Designed for tool integration
- 5:18Check Release Builds
- 8:44Write your checks in Kotlin
- 9:33Custom Check Project
- 10:03Client API vs Detector API
- 10:20Client API: LintClient
- 11:48Creating a lint check
- 13:12Text Format
- 14:55Detector Interfaces
- 18:54Linked Locations
- 19:36Detector Lifecycle
- 19:52Predefined Iteration Order
- 20:19Multipass Analysis
- 22:07Scopes: On the fly analysis
- 25:05UAST versus PSI PSE Program Structure Interface
- 25:38PSI exterior, UAST interior
- 26:33UastScanner
- 27:59Single Tree Iteration
- 28:36Important Helpers
- 29:00Constant Evaluator
- 29:49Type Evaluator
- 30:28Annotation Support
- 31:23Kotlin Argument Mapping
- 33:23Quickfixes - String Replacements
- 34:54Merged Manifest Support
- 35:25Call Graph Support
- 36:16Test DSL
- 36:26Gotcha's Things to look out for with Kotlin
related talks
24mImprove your code with Lint checks for Kotlin
42mSafe(r) Kotlin Code - Static Analysis Tools for Kotlin
37mKotlin on Code Quality Tools
22mKotlin on Code Quality Tools
21mMastering Code Quality: A Deep Dive into Custom Linting for Android Developers
21mGetting the most out of Android Lint
46mLint for Life: Your Customizable Guard On the Go
44mLint. What, Why, How?
