https://kotlinlang.org logo
Title
b

basher

08/15/2019, 8:27 PM
Is there some kind of linter that will warn if a class is not annotated as public or internal? I know there's a KEEP somewhere about adding an explicit access mode to the compiler, but I don't think that's done yet.
2
j

jw

08/16/2019, 12:12 AM
I think it was teased as "library" mode. It would require return types to be declared too. Do want.
b

basher

08/16/2019, 1:02 AM
Same. Just went back to add internal to a bunch of constructors I missed only because I realized if I had done it earlier, an earlier change wouldn't have been breaking 😩
j

jw

08/16/2019, 2:36 AM
Want to file a YouTrack?
This is something that the compiler engineers at Google could potentially pick up / help with since we want this for all our Kotlin libraries.
b

basher

08/16/2019, 3:35 AM
j

jw

08/16/2019, 3:46 AM
thanks!
b

basher

08/16/2019, 3:47 AM
No prob!
Also wonder if this is something that could be contributed to detekt as a style rule in the meantime: https://arturbosch.github.io/detekt/style.html
There are already some visibility modifier and other rules aimed at lib authors that feel adjacent