Inspectopedia Help

Const property naming convention

Reports const property names that do not follow the recommended naming conventions.

Consistent naming allows for easier code reading and understanding. According to the Kotlin official style guide, const properties should use uppercase underscore-separated names.

Example:

const val Planck: Double = 6.62607015E-34

The quick-fix renames the property:

const val PLANCK: Double = 6.62607015E-34

Inspection options

Option

Type

Default

Pattern

String

[A-Z][_A-Z\d]*

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023