There are two distinct sets of code checks: Android-specific lint checks built by Google, and general Kotlin code inspections built by JetBrains.
Analyze | Inspect Code shows you the results of running both sets of checks: the code inspections are "native" to IntelliJ IDEA, and the Android lint checks have been integrated into IntelliJ IDEA by the Android tools team.
Running ./gradlew lint
runs only the Android-specific lint checks. They did add the possibility to handle Kotlin code to these checks in recent versions of Android Studio, but they still check only for Android-specific issues, not general problems with Kotlin code.
If you want to run IntelliJ IDEA's checks from the command line, you can either use inspect.sh
as described in IntelliJ IDEA documentation, or you can use the experimental Gradle plugin for running IntelliJ IDEA inspections that JetBrains is working on. Note that the plugin will not run as part of ./gradlew lint
; you'll need to run a separate Gradle task to run its inspections.