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/extension-function-spacing

Language: Kotlin

Severity: Notice

Category: Code Style

Description

To keep code consistently styled, ensure there are no superfluous spaces in extension function declarations.

Non-Compliant Code Examples

fun <T>  List<T>.printAll() {}
fun <T> List <T>.printAll() {}
fun <T> List<T> .printAll() {}
fun <T> List<T>. printAll() {}

fun String ?.printAll() {}

fun String? .printAll() {}
fun String?. printAll() {}

fun Foo .Bar.printAll() {}
fun Foo. Bar.printAll() {}
fun Foo.Bar .printAll() {}
fun Foo.Bar. printAll() {}

fun Foo.Bar.printAll () {}
fun Foo.Bar.printAll (

) {}

Compliant Code Examples

fun <T> List<T>.printAll() {}

fun String?.printAll() {}

fun Foo.Bar.printAll() {}

fun Foo.Bar.printAll(

) {}
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

PREVIEWING: guacbot/translation-pipeline