Files
openide/plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ObjectPropertyName.html
Ilya Kirillov 3386f8f5a9 [kotlin] move inspection descriptions to separate module to reuse in K2
GitOrigin-RevId: e9d7382f4d640e27b1958d1bf2d4c3e639915137
2022-07-13 09:59:31 +00:00

27 lines
853 B
HTML

<html>
<body>
Reports properties that do not follow the naming conventions.
<p>The following properties are reported:</p>
<ul>
<li>Top-level properties</li>
<li>Properties in objects and companion objects</li>
</ul>
<p>You can specify the required pattern in the inspection options.</p>
<p><a href="https://kotlinlang.org/docs/coding-conventions.html#naming-rules">Recommended naming conventions</a>: it has to start with an uppercase letter, use camel case and no underscores.</p>
<p><b>Example:</b></p>
<pre><code>
// top-level property
val USER_NAME_FIELD = "UserName"
// top-level property holding reference to singleton object
val PersonComparator: Comparator&lt;Person&gt; = /*...*/
class Person {
companion object {
// property in companion object
val NO_NAME = Person()
}
}
</code></pre>
</body>
</html>