https://kotlinlang.org logo
#detekt
Title
# detekt
e

Ellen Spertus

10/18/2019, 8:20 PM
Also, why doesn’t detekt like my constant names? According to the style guide (https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules) constant property names should be UPPER_SNAKE_CASE.
I got an answer from my teammates: I should put this in a companion object. (Never mind that that’s the opposite of what another teammate told me a few weeks ago.)
a

alejandro

10/19/2019, 9:33 AM
They are not “real” constants as they are initialized on instantiating the class.
I’d move them outside the class and set them as
private const val
👍 1
b

Brais Gabin

10/19/2019, 12:58 PM
I agree with Alejando. Move them outside the class is even better than create a
companion object
1
2 Views