Lint works on UAST - yes. I’d rewrite the detekt rules to leverage UAST. We get so many things for free. Gradle Integration / Baseline / nice HTML reports / XML reports / quickfixes / IDE integration / inspection of any file type and so many more things
Additionally, Lint does work on Kotlin only projects - https://github.com/vanniktech/kotlin-on-code-quality-tools/tree/master/custom-android-lint-rules - they have their own plugin for that which can be applied to kotlin/java only modules and the same lint rules can be used
s
seb
03/08/2019, 9:34 AM
re: using Lint in non-Android projects… I didn’t know that. It’s cool! But what about all the built-in rules that only apply to Android projects? Isn’t that a massive waste of time to run those? Would we have to provide a lint.xml that disables all the rules?
v
vanniktech
03/08/2019, 1:54 PM
Android specific rules are not running when applying the plugin for Kotlin/Java
👍 1
vanniktech
03/08/2019, 1:54 PM
Most of the time spent when running lint is compiling code + mapping + type resolution
s
seb
03/08/2019, 1:55 PM
True, as long as you’re not running multi-pass rules (e.g., rules who require checking multiple files and/or both code and bytecode/resources/…)
v
vanniktech
03/08/2019, 1:56 PM
Even those are fast because the cost is paid upfront
s
seb
03/08/2019, 1:56 PM
Ah, must have changed since I last checked (2.x days)