Pattern: Missing underscore in numeric literal
Issue: -
Detects and reports decimal base 10
numeric literals above a certain length that should be underscore separated for readability. Underscores that do not make groups of 3
digits are also reported even if their length is under the acceptableDecimalLength
. For Serializable
classes or objects, the field serialVersionUID
is explicitly ignored.
Example of incorrect code:
object Money {
const val DEFAULT_AMOUNT = 1000000
}
Example of correct code:
object Money {
const val DEFAULT_AMOUNT = 1_000_000
}