Why Is There No Short Variable Inspection For Kotlin?

From https://intellij-support.jetbrains.com/hc/en-us/community/posts/360005852879-Why-Is-There-No-Short-Variable-Inspection-For-Kotlin-

In the Java - Naming conventions section of the Inspections there is an inspection called “Local variable naming convention” which says:

Reports local variables whose names are either too short, too long, or do not follow the specified regular expression pattern.
Use the fields below to specify minimum length, maximum length and regular expression expected for local variables names.
Specify 0 to not check the length of names. Regular expressions are in standard java.util.regex format.

In the Kotlin section there is an identically named inspection but it only says:

This inspection reports local variable names that do not follow the recommended naming conventions.

Why is there no check for variable name length in the Kotlin version?

It’s just not implemented. Java and Kotlin plugins have different inspections, so it’s not easily possible to reuse the existing ones from Java. You are welcome to file a feature request here: http://kotl.in/issue.

1 Like