Coding in style: Static analysis with Custom Lint Rules (Android Dev Summit '19)
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about writing custom Android Lint rules, since it shows the current API and how to register and ship them.
Recommended by 1 people across 1 different months, 2019 to 2020.
What it is
A 21-minute Android Dev Summit 2019 session by Alan Viverette and Rahul Ravikumar on writing custom Android Lint rules. It covers the basics of authoring a rule, testing it, and distributing it to a team so best practices are enforced automatically.
What people said
Recommends Louis Tsai · 2019-11 · Stack Overflow · on “Android custom lint rule does not detect any issue (for imports)”
I had the same problem, but it was cause by a missing apply plugin: 'kotlin' in the build.gradle for the lint rules' build.gradle , which is not your problem. But you might want to catch up with the latest version of the API, with this video from ADS [this video] . Google really should update their documentations Some notable differences: declare registry in a resources file AGP 3.5.1
Cites eqtèöck · 2020-03 · Stack Overflow · on “Custom Lint annotation detector is not triggered”
I am trying to write my first Lint rule. For now I just want to detect the use of the annotation @AnyThread . I have created a module to implement my custom rule. The gradle file for this module is (I use the gradle plugin version 3.6.1): targetCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8 dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" compileOnly 'com.android.tools.lint:lint-api:26.6.1' compileOnly 'com.android.tools.lint:lint-checks:26.6.1' testImplementation "com.android.tools.lint:lint:26.6.1" testImplementation "com.android.tools.lint:lint-tests:26.6.1"
Cites Xid · 2020-10 · Stack Overflow · on “How to configure ktlint gradle plugin in a continuous mode?”
It is not possible to do that. klint is not a static analysis [LINK] tool. Alternatively, you can write custom lint rules [LINK] for the same. Here are some resources for doing so: Android Dev summit 2018 talk [LINK] Android Dev summit 2019 talk [this video] Android source code for standard lint rules [LINK] Repos [LINK] [LINK] [LINK]