Inspectopedia Help

Object private property naming convention

Reports properties that do not follow the naming conventions.

The following properties are reported:

  • Private properties in objects and companion objects

You can specify the required pattern in the inspection options.

Recommended naming conventions: it has to start with an underscore or an uppercase letter, use camel case.

Example:

class Person { companion object { // property in companion object private val NO_NAME = Person() } }

Inspection options

Option

Type

Default

Pattern

String

_?[A-Za-z][_A-Za-z\d]*

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023