Kotlin file names


I started to write some code in Kotlin.
I don¨t want to write every class in separate file as IntelliJ suggests, Kotlin classes are often small. But I need some system how to find specific class. So I started to use this conventions for file names:

kotlin file = kotlin package

      |-c.kt - package x.y.z.a.c
      |-d.kt - package x.y.z.a.d
    |-a.kt - package x.y.z.a
    |-b.kt - package x.y.z.b

What do you think about it?


You can refer to the structure of JS projects.


I consider this pattern clear and readable, unfortunately I didn’t found any way to check the package pattern consistency.


It would be nice to see warnings in ide on the rule violation and to have support for refatoring on file movement… May be in the future.

How create file names you or other kotliners?