https://kotlinlang.org logo
Title
x

xenoterracide

12/13/2018, 5:52 PM
are their code quality tools that work with kotlin? checkstyle, spotbugs, and error prone are what I use with java.
s

Steven McLaughlin

12/13/2018, 6:10 PM
There's this: https://ktlint.github.io/ It can at least be a starting point to cover some of what you listed
x

xenoterracide

12/13/2018, 6:26 PM
hmm… k, error-prone is a compiler plugin, not sure if maybe it can just be used? same with spotbugs, since it does byte code analysis
s

Steven McLaughlin

12/13/2018, 6:34 PM
I'd give it a shot. I've never worked with either of those two, but they may just work as-is.
m

Mike

12/13/2018, 6:41 PM
Detekt is really good too! I would hope that things checked for by error prone either aren't possible in kotlin or are caught by kotlin compiler.
x

xenoterracide

12/13/2018, 7:12 PM
what’s Detekt?
I know I can google
s

Steven McLaughlin

12/13/2018, 7:14 PM
static code analysis
x

xenoterracide

12/13/2018, 7:16 PM
one of the things EP checks for is an inversion of final… meaning all local vars must be effectively final unless you specify
@Var,
, I’m not sure if this is useful in kotlin, can you create a local/parameter without var/val?
one of the big reasons I use EP
m

Mike

12/13/2018, 8:27 PM
val is final, var is not. So I guess if you used
var
in Kotlin, EP would flag it.
So if you used EP, you’d have to do
@Var var myVariable
. Does provide additional incentive to not use var, which is generally easy to avoid in Kotlin anyway.
j

Jukka Siivonen

12/13/2018, 8:56 PM
#detekt