Neeraja
12/23/2025, 12:01 PMconst, or top-level or object val properties with no custom get function that hold deeply immutable data) should use all uppercase, underscore-separated names following the screaming snake case convention
There is a Detekt rule ObjectPropertyNaming and TopLevelPropertyNaming that has config options for consts. However I don't see anything that enforces screaming snake case for the vals. There is another rule MayBeConst that reports when a val should be a const but it mainly checks for primitive types. There could be vals which are technically immutable but can't be declared as const due to the way IntelliJ defines a const. For example:
object Classes {
/** JUnit annotations that indicate a setup method. */
val JUNIT_SETUP_ANNOTATED_METHOD = setOf("BeforeEach", "BeforeAll")
}
According to the convention this should be screaming snake case but there's nothing in Detekt to enforce this?schalkms
12/28/2025, 11:10 PM