In Kotlin, it’s a convention to name classes using upper camel case. This rule ensures that class names start with an uppercase letter and have no underscores. This helps enhances readability and allows for differentiation between class names and other identifiers in the code.
Non-Compliant Code Examples
classfooclassFoo_Barclass`Some class in the production code`
Compliant Code Examples
classFoo{}classFoo1{}classFooBar{}// Any keyword is allowed when wrapped between backticks
class`class`
Seamless integrations. Try Datadog Code Security
Datadog Code Security
Try this rule and analyze your code with Datadog Code Security
How to use this rule
1
2
rulesets:- kotlin-best-practices # Rules to enforce Kotlin best practices.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Security scans to your CI pipelines