https://kotlinlang.org logo
#ktlint
Title
# ktlint
j

Jonathan Lennox

09/28/2023, 7:07 PM
A question: I notice that in ktlint 1.0.0, incorrectly-named local variables are warned about with the rule
ktlint:standard:property-naming
. E.g. in
Copy code
fun timeSince(then: Instant): Double {
    val now = Clock.systemUTC().instant()
    val duration = Duration.between(then, now)
    val duration_s = duration.toNanos() / 1e9
    return duration_s
}
that's the rule that warns about the name of
duration_s
, even though that's a read-only local variable, not a property. Is the rule just named badly, or is that a bug in the rule's application?