The name of a local val or var starts in upper case or contains underscores
What it finds
Local val and var names are in lower camel case by the Kotlin coding conventions.
From the rule's source, local_variable_naming.rs.
fun total(items: List<Int>): Int { val item_count = items.sizetx0 reports: the variable item_count is not in lower camel case val Sum = items.sum()tx0 reports: the variable Sum val (first, _) = Pair(1, 2) val ok = item_count + Sum return ok + first} Turn it on, off or suppress it
The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/kotlin:local-variable-naming" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/kotlin:local-variable-naming] reason="..."tx0 explain tx0/kotlin:local-variable-naming shows the same in the terminal. Found a false positive? Report it.