Kotlin

Kotlin

Made by DeepSource

Non-compliant enum variant name detected KT-C1001

Style
Major

Ensure that enum variants are consistently named.

Kotlin's naming conventions suggest using PascalCase for enum names, where the first letter of each word is capitalized.

If enum names do not follow this convention, it can lead to confusion and inconsistency in the codebase.

Bad Practice

enum class SomeEnum {
    variant1,
    variant_two,
    // ...
}

Recommended

Follow Kotlin's naming conventions throughout your codebase.

enum class SomeEnum {
    Variant1,
    VariantTwo,
}

References

  • Kotlin official documentation - Naming Rules for more details on the naming conventions.