This product is not supported for your selected Datadog site. ().
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Metadata

ID: kotlin-code-style/argument-list-wrapping

Language: Kotlin

Severity: Notice

Category: Code Style

Description

All arguments should be on separate lines or the same line.

In long argument lists, put a line break after the opening parenthesis. Indent arguments, and group multiple closely related arguments near each other.

Non-Compliant Code Examples

val foo =
    foo(
        a,
        b, c,
    )

val bar =
    foo(
        a,
        b, c, // hi
    )

    

Compliant Code Examples

val foo =
    foo(
        a,
        b,
        c,
    )

val foo = foo(a, b, c)

private fun telemetryAttributes(
    element: PsiElement,
    logInfo: LogLineInfo
) = mapOf(
    "language" to element.language.id,
    "framework" to logInfo.framework, // deprecated - see IDE-3771 (suggest to remove after May-2025)
    "logs.framework" to logInfo.framework,
    "logs.level" to (logInfo.level?.label ?: "")
)

val servicesWithProfiling = client.profilingApi().findServicesWithProfiling(
                emptySet(),
                ctx.environment, // do we want to pass the env?
                ctx.timeInterval // use context interval
)

drawSquare(
    x = 10, y = 10,
)
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security