mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
28 lines
1.1 KiB
HTML
28 lines
1.1 KiB
HTML
<html>
|
|
<body>
|
|
Reports local variables that do not follow the naming conventions.
|
|
<p>You can specify the required pattern in the inspection options.</p>
|
|
<p><a href="https://kotlinlang.org/docs/coding-conventions.html#function-names">Recommended naming conventions</a>: it has to start with a lowercase letter, use camel case and no underscores.</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
fun fibonacciNumber(index: Int): Long = when(index) {
|
|
0 -> 0
|
|
else -> {
|
|
// does not follow naming conventions: contains underscore symbol (`_`)
|
|
var number_one: Long = 0
|
|
// does not follow naming conventions: starts with an uppercase letter
|
|
var NUMBER_TWO: Long = 1
|
|
// follow naming conventions: starts with a lowercase letter, use camel case and no underscores.
|
|
var numberThree: Long = number_one + NUMBER_TWO
|
|
|
|
for(currentIndex in 2..index) {
|
|
numberThree = number_one + NUMBER_TWO
|
|
number_one = NUMBER_TWO
|
|
NUMBER_TWO = numberThree
|
|
}
|
|
numberThree
|
|
}
|
|
}
|
|
</code></pre>
|
|
</body>
|
|
</html> |