KotlinConf 2017 - Kotlin Static Analysis with Android Lint by Tor Norbye

JetBrains · 6K views · 2017 · 41:13

Open on YouTube

Testing, debugging & developer toolsCompilers, interpreters & program analysisSoftware practice, open source & careerstalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about configuring Android Lint or writing custom lint rules, since it comes from the tool's own author.

Recommended by 2 people across 2 different months, 2017 to 2021.

What it is

A KotlinConf 2017 talk by Tor Norbye, tech lead for Android Studio at Google and author of Android Lint. It covers how Android Lint works internally, the UAST library, and how to write custom lint checks and IDE quickfixes for Kotlin.

What people said

Recommends azizbekian · 2017-11 · Stack Overflow · on “Prevent code accidentally going into production”

Starting from Android Gradle Plugin 3.0 [LINK] you can make following configuration in build.gradle file: android { lintOptions { fatal 'StopShip' } } This will break the build as long as there exists a StopShip comment in codebase. Watch the exact minute [this video] of Tor Norbye's "Kotlin Static Analysis with Android Lint" talk, where he talks about the feature.

Recommends Vlad · 2021-08 · Stack Overflow · on “How to mark not to call super class' implementation when overriding?”

You would need to define a separate lint detector for that. Lint highlights overrides which should call super, but don't, by use of @CallSuper annotation, which is what this Lint detector enables: [LINK] Granted that might be something new to learn first, but writing custom Lint rules is not that hard. These are some good starting points: Android Lint Tool Guide [LINK] 2017 Kotlin Conference Lint Talk [this video]

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"