Building a better codebase with Lint
summary
Adds custom lint rules to enforce design tokens and catches missing TextView styles at build time. Implements a registry and an issue called MissingStyleAttribute with severity set to error, uses a ResourceXmlDetector limited to layout folders, checks TextView for a style attribute and reports file and line. Replaces forbidden usages (example: Snackbar → TicketTipSnackbar), runs in IDE and CI, uses a baseline file lint-baseline.xml to absorb legacy violations, and costs about 30–90 seconds extra build time.
AI-written summary · about
chapters (12)
- 0:00Introduction to lint
- 2:46What is lint used for
- 5:33Why write custom lint rules
- 8:41Setting up lint module
- 11:29Lint rule structure basics
- 13:57Design system lint example
- 17:50Writing custom lint detectors
- 23:51Integrating lint in workflow
- 27:11Lint performance considerations
- 29:19Kotlin lint rule tips
- 31:05Resources for learning
- 32:35Q&A session
