The name of a local variable or parameter does not match the configured pattern
What it finds
The names of local variables and parameters, of methods, lambdas, catch clauses, resources and patterns alike, are checked against the parameter pattern, by default [a-z][a-zA-Z0-9]*, lower camel case. The unnamed variable _ is left alone.
From the rule's source, local_naming.rs.
import java.util.List; class Sums { int sum(List<Integer> Values) {tx0 reports: the local name Values does not match int total = 0; for (int Item : Values) {tx0 reports: the local name Item does not match total += Item; } int RESULT = total;tx0 reports: the local name RESULT does not match Values.forEach(v -> {}); return RESULT; }} Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/java:local-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/java:local-naming] reason="..."tx0 explain tx0/java:local-naming shows the same in the terminal. Found a false positive? Report it.