If the file is named Foo.kt and there's only one declaration (object, class, enum or interface) this file name should match the declaration name.
Positive case:
Something.kt
object Something
Negative case:
Something.kt
object Somethin
Also I'd expect this check to work when there are top level variables declared:
Something.kt
const val MEANING_OF_LIFE = 42
object Something
What do you think?
I want this rule too :D. Selfassigned.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.
Most helpful comment
The rule would mark this file, for example:
https://github.com/arturbosch/detekt/blob/994c732c5f45ebdbb50a917b272f87a9c0f5916f/detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/ComplexConditionSpek.kt#L12