All Projects → alexjlockwood → Android Lint Checks Demo

alexjlockwood / Android Lint Checks Demo

Licence: apache-2.0
A demo project that shows how to setup and write some basic custom lint checks.

Programming Languages

kotlin
9241 projects

android-lint-checks-demo

This is a simple demo repo that shows how to configure and write custom lint checks in an Android project.

Custom lint checks

Custom lint checks are a great way to prohibit usages of certain classes and resources in a codebase. To demonstrate their power, this project contains the following custom lint checks:

You can see the lint checks show up as errors if you open this project in Android Studio and look at the MainActivity.kt and activity_main.xml files.

You can view the unit tests for each custom lint check here.

Project setup

This project contains the following two modules:

Lint check jar library (checks/)

This module is the lint check jar library that other Android library modules can consume. It contains the custom lint check implementations listed above, each of which are listed in the IssueRegistry class.

Android app module (app/)

This module contains a generic sample Android app. In order to get the custom lint checks running on the code in this module, it depends on the checks module in the app/build.gradle file:

dependencies {
    lintChecks project(':checks')
}

Additional resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].