Stop Debating. Start Enforcing with Lint Rules
summary
Argues that architectural debates in PRs become automated checks by writing lint rules with Consist, which expresses rules as Consist lint rules as unit tests using a given–when–then API (JUnit or KoTest), runs on the JVM, and is executed in CI via Gradle/GitHub Actions. Shows concrete rules: require ViewModels to extend Android Jetpack ViewModel, ban repository parameters in ViewModel constructors, forbid resource imports in ViewModels, limit use cases to one public function, and catch Retrofit bugs like Retrofit @Field requires @FormUrlEncoded; demonstrates handling legacy code with a baseline for known violations and a failing run that finds two violations.
AI-written summary · about
chapters (12)
- 0:00Introduction and code review struggles
- 4:17The real problem behind code review debates
- 7:08Why custom lint rules matter for architecture
- 8:32Consist framework and its unit test approach
- 11:46Writing and running your first lint rule
- 15:35Enforcing architecture with lint rules
- 20:11Preventing bugs with custom lint rules
- 24:07Project structure for lint rules
- 25:35Automating lint rules in CI/CD
- 27:24Benefits of enforcing architecture early
- 31:57Resources and community for Consist
- 32:17Key takeaways and closing remarks
related talks
20mClean Code Base: Harnessing the Power of Android Lint and Custom Rules
46mLint for Life: Your Customizable Guard On the Go
44mLint. What, Why, How?
24mImprove your code with Lint checks for Kotlin
44mStop fighting useless battles: automate code style, architecture compliance
19mThe power of custom lint checks
19mYour Build, Your Rules
30mAccelerating the Dev Loop with DCM Lints at Betterment
