This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Metadata

ID: kotlin-code-style/brace-spacing

Language: Kotlin

Severity: Notice

Category: Code Style

Description

In lambda expressions, there should be a space separating each brace from the function’s body. If the function takes parameters, there should also be a space on either side of the arrow.

Non-Compliant Code Examples

val values = list.filter {it > 10}
val values = list.filter { x->x > 10 }

Compliant Code Examples

val values = list.filter { it > 10 }
val values = list.filter { x -> x > 10 }
val values = list.filter int@{ it > 10 }
val values = list.filter {
    it > 10
}
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Integraciones sin problemas. Prueba Datadog Code Security

PREVIEWING: guillaume.barrier/ERRORT-5095-general-doc-update